Merge pull request #449 from jkominek/python-getfullargspec

use inspect.getfullargspec when available
This commit is contained in:
A.J. Beamon 2018-06-12 11:58:04 -07:00 committed by GitHub
commit a1901701d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -227,7 +227,10 @@ def transactional(*tr_args, **tr_kwargs):
wfunc = func
while getattr(wfunc, '__wrapped__', None):
wfunc = wfunc.__wrapped__
index = inspect.getargspec(wfunc).args.index(parameter)
if hasattr(inspect, 'getfullargspec'):
index = inspect.getfullargspec(wfunc).args.index(parameter)
else:
index = inspect.getargspec(wfunc).args.index(parameter)
if getattr(func, '_is_coroutine', False):
@functools.wraps(func)