8000 Fix deprecated decorator function that didn't work in Python 3 · BioComputing/twilio-python@3519817 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /react-partial>

Commit 3519817

Browse files
committed
Fix deprecated decorator function that didn't work in Python 3
1 parent d833182 commit 3519817

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

twilio/jwt/access_token/grants.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ def deprecated(func):
1010

1111
@functools.wraps(func)
1212
def new_func(*args, **kwargs):
13-
warnings.warn_explicit(
14-
"Call to deprecated function {}.".format(func.__name__),
15-
category=DeprecationWarning,
16-
filename=func.func_code.co_filename,
17-
lineno=func.func_code.co_firstlineno + 1
18-
)
13+
warnings.simplefilter('always', DeprecationWarning)
14+
warnings.warn("Call to deprecated function {}.".format(func.__name__), category=DeprecationWarning, stacklevel=2)
15+
warnings.simplefilter('default', DeprecationWarning)
1916
return func(*args, **kwargs)
17+
2018
return new_func
2119

2220

0 commit comments

Comments
 (0)
0