diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-08-06 13:34:09 -0400 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-08-06 13:34:09 -0400 |
commit | 1a46f7e5424b161bf8c94d2e48f868b09e3d5ff5 (patch) | |
tree | f85f6e29720bef6ddf88c205185bbd19fb00936b /igor.py | |
parent | 865a84c1cc6eeef8f5bcf5932c148605486eae71 (diff) | |
download | python-coveragepy-git-1a46f7e5424b161bf8c94d2e48f868b09e3d5ff5.tar.gz |
Stop using inspect.getargspec() function (removed in Python 3.6).
Diffstat (limited to 'igor.py')
-rw-r--r-- | igor.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -313,8 +313,11 @@ def analyze_args(function): star(boolean): Does `function` accept *args? num_args(int): How many positional arguments does `function` have? """ - with ignore_warnings(): - argspec = inspect.getargspec(function) + try: + getargspec = inspect.getfullargspec + except AttributeError: + getargspec = inspect.getargspec + argspec = getargspec(function) return bool(argspec[1]), len(argspec[0]) |