summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-09-07 16:56:24 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-09-07 16:56:24 (GMT)
commita6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 (patch)
tree1c31738009bee903417cea928e705a112aea2392 /Lib/test/support
parent1f06a680de465be0c24a78ea3b610053955daa99 (diff)
downloadcpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.zip
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.gz
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.bz2
bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config * Always define WITH_THREAD for compatibility.
Diffstat (limited to 'Lib/test/support')
-rw-r--r--Lib/test/support/__init__.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 0235498..bfceba1 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -25,6 +25,8 @@ import subprocess
import sys
import sysconfig
import tempfile
+import _thread
+import threading
import time
import types
import unittest
@@ -32,11 +34,6 @@ import urllib.error
import warnings
try:
- import _thread, threading
-except ImportError:
- _thread = None
- threading = None
-try:
import multiprocessing.process
except ImportError:
multiprocessing = None
@@ -2028,16 +2025,11 @@ environment_altered = False
# at the end of a test run.
def threading_setup():
- if _thread:
- return _thread._count(), threading._dangling.copy()
- else:
- return 1, ()
+ return _thread._count(), threading._dangling.copy()
def threading_cleanup(*original_values):
global environment_altered
- if not _thread:
- return
_MAX_COUNT = 100
t0 = time.monotonic()
for count in range(_MAX_COUNT):
@@ -2061,9 +2053,6 @@ def reap_threads(func):
ensure that the threads are cleaned up even when the test fails.
If threading is unavailable this function does nothing.
"""
- if not _thread:
- return func
-
@functools.wraps(func)
def decorator(*args):
key = threading_setup()