mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Block the sys.exc_clear -3 warning from threading.py.
This commit is contained in:
parent
e34c21c2a0
commit
105f3d4fdc
1 changed files with 7 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ except ImportError:
|
||||||
del _sys.modules[__name__]
|
del _sys.modules[__name__]
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
import warnings
|
||||||
from time import time as _time, sleep as _sleep
|
from time import time as _time, sleep as _sleep
|
||||||
from traceback import format_exc as _format_exc
|
from traceback import format_exc as _format_exc
|
||||||
from collections import deque
|
from collections import deque
|
||||||
|
|
@ -24,6 +25,12 @@ ThreadError = thread.error
|
||||||
del thread
|
del thread
|
||||||
|
|
||||||
|
|
||||||
|
# sys.exc_clear is used to work around the fact that except blocks
|
||||||
|
# don't fully clear the exception until 3.0.
|
||||||
|
warnings.filterwarnings('ignore', category=DeprecationWarning,
|
||||||
|
module='threading', message='sys.exc_clear')
|
||||||
|
|
||||||
|
|
||||||
# Debug support (adapted from ihooks.py).
|
# Debug support (adapted from ihooks.py).
|
||||||
# All the major classes here derive from _Verbose. We force that to
|
# All the major classes here derive from _Verbose. We force that to
|
||||||
# be a new-style class so that all the major classes here are new-style.
|
# be a new-style class so that all the major classes here are new-style.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue