]> granicus.if.org Git - python/commitdiff
Get command-line doctest of Lib/decimal.py to work again.
authorRaymond Hettinger <python@rcn.com>
Tue, 1 Feb 2011 23:54:43 +0000 (23:54 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 1 Feb 2011 23:54:43 +0000 (23:54 +0000)
If tested as '__main__' instead 'decimal', the tracebacks would
abbreviate 'decimal.Inexact' as 'Inexact', breaking the doctests.

(Reviewed by Antoine.)

Lib/decimal.py

index 1fe938f06c438bc8566af12b10f669f0a4d90bef..c387de60b63ea47cc058774a46bb91667c30225c 100644 (file)
@@ -6245,5 +6245,5 @@ _PyHASH_10INV = pow(10, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
 
 
 if __name__ == '__main__':
-    import doctest, sys
-    doctest.testmod(sys.modules[__name__])
+    import doctest, decimal
+    doctest.testmod(decimal)