diff options
author | Antoine Pitrou <pitrou@free.fr> | 2017-09-07 18:56:24 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-09-07 18:56:24 +0200 |
commit | a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 (patch) | |
tree | 1c31738009bee903417cea928e705a112aea2392 /Lib/trace.py | |
parent | Add props file for nuget packages (#3410) (diff) | |
download | cpython-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-x | Lib/trace.py | 24 |
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" |