[Python-checkins] python/dist/src/Lib/test test_decimal.py, 1.15, 1.15.2.1

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sat Dec 18 20:12:14 CET 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1715/test

Modified Files:
      Tag: release24-maint
	test_decimal.py 
Log Message:
Bug #1083645

* The decimal module wouldn't run on builds without threads.



Index: test_decimal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_decimal.py,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- test_decimal.py	24 Nov 2004 07:28:48 -0000	1.15
+++ test_decimal.py	18 Dec 2004 19:12:11 -0000	1.15.2.1
@@ -32,8 +32,11 @@
 import pickle, copy
 from decimal import *
 from test.test_support import TestSkipped, run_unittest, run_doctest, is_resource_enabled
-import threading
 import random
+try:
+    import threading
+except ImportError:
+    threading = None
 
 # Useful Test Constant
 Signals = getcontext().flags.keys()
@@ -724,7 +727,11 @@
 class DecimalUseOfContextTest(unittest.TestCase):
     '''Unit tests for Use of Context cases in Decimal.'''
 
-    import threading
+    try:
+        import threading
+    except ImportError:
+        threading = None
+
     # Take care executing this test from IDLE, there's an issue in threading
     # that hangs IDLE and I couldn't find it
 
@@ -745,6 +752,9 @@
         self.finish1.wait()
         return
 
+    if threading is None:
+        del test_threading
+
 
 class DecimalUsabilityTest(unittest.TestCase):
     '''Unit tests for Usability cases of Decimal.'''



More information about the Python-checkins mailing list