summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-12-18 19:07:19 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-12-18 19:07:19 (GMT)
commit7e71fa5cfa250968eafdb77356621e3a9bbb0648 (patch)
tree994cd01f51395f71051589ad32f3af0bfb2b779e /Lib/test/test_decimal.py
parent193814c3082f1b81772009f9b7545278f16c3428 (diff)
downloadcpython-7e71fa5cfa250968eafdb77356621e3a9bbb0648.zip
cpython-7e71fa5cfa250968eafdb77356621e3a9bbb0648.tar.gz
cpython-7e71fa5cfa250968eafdb77356621e3a9bbb0648.tar.bz2
Bug #1083645
* The decimal module wouldn't load on builds without threads.
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 06e8b9d..f523a72 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -32,8 +32,11 @@ import os, sys
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 @@ def thfunc2(cls):
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 @@ class DecimalUseOfContextTest(unittest.TestCase):
self.finish1.wait()
return
+ if threading is None:
+ del test_threading
+
class DecimalUsabilityTest(unittest.TestCase):
'''Unit tests for Usability cases of Decimal.'''