callable.py: Silence getargspec deprecation warning
The code will first try to use the newer getfullargspec method.
@@ -15,9 +15,9 @@ Conditions) and MAYBE in *customized* reporters e.g. subclasses.
from __future__ import absolute_import, print_function, unicode_literals
from builtins import object
import sys
-try:
+try: # Try to get the newer Python 3.x method...
from inspect import getfullargspec as getargspec
-except ImportError:
+except ImportError: # ...and fall back to the deprecated method in Python 2.
from inspect import getargspec
from functools import wraps
@@ -57,7 +57,7 @@ class FontbakeryCallable(object):
@property
@cached_getter
def mandatoryArgs(self):
- argspec = getargspec(self._func)
+ argspec = getargspec(self._func) # noqa pylint: disable=deprecated-method
args = argspec.args[:-len(argspec.defaults)] \
if argspec.defaults is not None else argspec.args
@@ -68,7 +68,7 @@ class FontbakeryCallable(object):
@property
@cached_getter
def optionalArgs(self):
- argspec = getargspec(self._func)
+ argspec = getargspec(self._func) # noqa pylint: disable=deprecated-method
return tuple(argspec.args[-len(argspec.defaults):] \
if argspec.defaults is not None else [])
