Skip to content

Commit

Permalink
Merge pull request #222 from kevinanewman/patch-1
Browse files Browse the repository at this point in the history
Update __init__.py due to deprecated inspect.getargspec()
  • Loading branch information
pgiri committed Nov 4, 2023
2 parents 5d7394d + 97b1d12 commit 5e136ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions py3/__init__.py
Expand Up @@ -2608,15 +2608,15 @@ def __init__(self, computation, nodes=None, depends=[], job_status=None, cluster
assert inspect.isfunction(job_status) or inspect.ismethod(job_status), \
'"job_status" must be a function or method'
try:
args = inspect.getargspec(job_status)
args = inspect.getfullargspec(job_status)
if inspect.isfunction(job_status):
assert len(args.args) == 1
else:
assert len(args.args) == 2
if args.args[0] != 'self':
logger.warning('First argument to "job_status" method is not "self"')
assert args.varargs is None
assert args.keywords is None
assert args.varkw is None and not args.kwonlyargs
assert args.defaults is None
except Exception:
raise Exception('Invalid "job_status" function; '
Expand All @@ -2627,15 +2627,15 @@ def __init__(self, computation, nodes=None, depends=[], job_status=None, cluster
assert inspect.isfunction(cluster_status) or inspect.ismethod(cluster_status), \
'"cluster_status" must be a function or method'
try:
args = inspect.getargspec(cluster_status)
args = inspect.getfullargspec(cluster_status)
if inspect.isfunction(cluster_status):
assert len(args.args) == 3
else:
assert len(args.args) == 4
if args.args[0] != 'self':
logger.warning('First argument to "cluster_status" method is not "self"')
assert args.varargs is None
assert args.keywords is None
assert args.varkw is None and not args.kwonlyargs
assert args.defaults is None
except Exception:
raise Exception('Invalid "cluster_status" function; '
Expand Down

0 comments on commit 5e136ee

Please sign in to comment.