deprecated_call dit not revert functions back to original
Make sure that the warnings.warn and warnings.warn_explicit are reverted to there original function after running the function in deprecated_call
This commit is contained in:
parent
e84c00efae
commit
89b00d714f
|
@ -45,8 +45,8 @@ def deprecated_call(func, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
ret = func(*args, **kwargs)
|
ret = func(*args, **kwargs)
|
||||||
finally:
|
finally:
|
||||||
warnings.warn_explicit = warn_explicit
|
warnings.warn_explicit = oldwarn_explicit
|
||||||
warnings.warn = warn
|
warnings.warn = oldwarn
|
||||||
if not l:
|
if not l:
|
||||||
__tracebackhide__ = True
|
__tracebackhide__ = True
|
||||||
raise AssertionError("%r did not produce DeprecationWarning" %(func,))
|
raise AssertionError("%r did not produce DeprecationWarning" %(func,))
|
||||||
|
|
Loading…
Reference in New Issue