aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <pitrou@free.fr>2017-09-07 18:56:24 +0200
committerVictor Stinner <victor.stinner@gmail.com>2017-09-07 18:56:24 +0200
commita6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 (patch)
tree1c31738009bee903417cea928e705a112aea2392 /Lib/trace.py
parentAdd props file for nuget packages (#3410) (diff)
downloadcpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.gz
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.tar.bz2
cpython-a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344.zip
bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config * Always define WITH_THREAD for compatibility.
Diffstat (limited to 'Lib/trace.py')
-rwxr-xr-xLib/trace.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/Lib/trace.py b/Lib/trace.py
index e443edd6061..48a1d1b6a91 100755
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -61,21 +61,15 @@ import dis
import pickle
from time import monotonic as _time
-try:
- import threading
-except ImportError:
- _settrace = sys.settrace
-
- def _unsettrace():
- sys.settrace(None)
-else:
- def _settrace(func):
- threading.settrace(func)
- sys.settrace(func)
-
- def _unsettrace():
- sys.settrace(None)
- threading.settrace(None)
+import threading
+
+def _settrace(func):
+ threading.settrace(func)
+ sys.settrace(func)
+
+def _unsettrace():
+ sys.settrace(None)
+ threading.settrace(None)
PRAGMA_NOCOVER = "#pragma NO COVER"