Skip to content

Commit ac599f1

Browse files
committed
pyhal.py: Fix warning: warnings.simplefilter() is global
Instead use FutureWarning which is normaly visible for users
1 parent 52c64cf commit ac599f1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/python/pyhal.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ def pyhaldeprecate(reason):
4848
def decorator(func):
4949
@functools.wraps(func)
5050
def warnfunc(*args, **kwargs):
51-
warnings.simplefilter('always', DeprecationWarning)
5251
warnings.warn("Use of deprecated class/function {} ({}).".format(func.__name__, reason),
53-
category=DeprecationWarning, stacklevel=2)
54-
warnings.simplefilter('default', DeprecationWarning)
52+
FutureWarning, stacklevel=2)
5553
return func(*args, **kwargs)
5654
return warnfunc
5755
return decorator

0 commit comments

Comments
 (0)