From fb40a3c79b3fa59cb589a642d0c4b8fa87ca082e Mon Sep 17 00:00:00 2001 From: Eric McDonald Date: Fri, 28 Oct 2022 17:56:45 -0700 Subject: [PATCH] Hacky fix for Python 3.11 compatibility. --- invoke/_version.py | 2 +- invoke/tasks.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/invoke/_version.py b/invoke/_version.py index 17f4ce42..98f13cbc 100644 --- a/invoke/_version.py +++ b/invoke/_version.py @@ -1,2 +1,2 @@ -__version_info__ = (1, 7, 3) +__version_info__ = (1, 7, 6) __version__ = ".".join(map(str, __version_info__)) diff --git a/invoke/tasks.py b/invoke/tasks.py index f2069916..3ddf0bfe 100644 --- a/invoke/tasks.py +++ b/invoke/tasks.py @@ -4,12 +4,12 @@ """ from copy import deepcopy -import inspect import types from .context import Context from .parser import Argument, translate_underscores from .util import six +from .vendor.decorator import getargspec if six.PY3: from itertools import zip_longest @@ -150,7 +150,7 @@ def argspec(self, body): # TODO: __call__ exhibits the 'self' arg; do we manually nix 1st result # in argspec, or is there a way to get the "really callable" spec? func = body if isinstance(body, types.FunctionType) else body.__call__ - spec = inspect.getargspec(func) + spec = getargspec(func) arg_names = spec.args[:] matched_args = [reversed(x) for x in [spec.args, spec.defaults or []]] spec_dict = dict(zip_longest(*matched_args, fillvalue=NO_DEFAULT))