summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-12-18 19:12:11 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-12-18 19:12:11 (GMT)
commita8ceba90c344bec9320c9287acd8273337aafc50 (patch)
tree49fc48f04dfbe27379f64d75a05be80df9a7b08e /Lib/test
parent995d9bf1279dece2c43347fc94c861f6a798fc1f (diff)
downloadcpython-a8ceba90c344bec9320c9287acd8273337aafc50.zip
cpython-a8ceba90c344bec9320c9287acd8273337aafc50.tar.gz
cpython-a8ceba90c344bec9320c9287acd8273337aafc50.tar.bz2
Bug #1083645
* The decimal module wouldn't run on builds without threads.
Diffstat (limited to 'Lib/test')
-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.'''