mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Bug #1083645
* The decimal module wouldn't load on builds without threads.
This commit is contained in:
parent
193814c308
commit
7e71fa5cfa
2 changed files with 25 additions and 4 deletions
|
|
@ -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.'''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue