From 8f0d4f367d13b94f99b2c3ad0321788be96aedf8 Mon Sep 17 00:00:00 2001 From: Akio Taniguchi Date: Mon, 17 Jun 2024 01:43:22 +0000 Subject: [PATCH] #2 Fix to use getfullargspec instead of getargspec --- scripts/libs/bbsweeplib/cache.py | 4 ++-- scripts/libs/fit/fit.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/libs/bbsweeplib/cache.py b/scripts/libs/bbsweeplib/cache.py index a5aee7d..b7987cb 100755 --- a/scripts/libs/bbsweeplib/cache.py +++ b/scripts/libs/bbsweeplib/cache.py @@ -34,9 +34,9 @@ def get_cache(self, name): else: func = getattr(self, name) orig_func = func.orig_func - argspec = inspect.getargspec(orig_func) + argspec = inspect.getfullargspec(orig_func) # print argspec - args, varargs, kws, defaults = argspec + args, varargs, kws, defaults, *_ = argspec # print argspec if args == ['self'] and varargs is None and kws is None: return func() diff --git a/scripts/libs/fit/fit.py b/scripts/libs/fit/fit.py index 9587988..c17c5a4 100755 --- a/scripts/libs/fit/fit.py +++ b/scripts/libs/fit/fit.py @@ -43,7 +43,7 @@ def _fit(function, xs, ys, err=None, via=None, range=None, silent=False, if type(function) == Expr_with_args: tmpargs = function.arg_names else: - argspec = inspect.getargspec(func) + argspec = inspect.getfullargspec(func) tmpargs = argspec.args[1:] ## prepare params argument