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:
Pieter Mulder 2015-06-25 14:53:54 +02:00
parent e84c00efae
commit 89b00d714f
1 changed files with 2 additions and 2 deletions

View File

@ -45,8 +45,8 @@ def deprecated_call(func, *args, **kwargs):
try:
ret = func(*args, **kwargs)
finally:
warnings.warn_explicit = warn_explicit
warnings.warn = warn
warnings.warn_explicit = oldwarn_explicit
warnings.warn = oldwarn
if not l:
__tracebackhide__ = True
raise AssertionError("%r did not produce DeprecationWarning" %(func,))