From d768a43280ae27d498603d155a63b9f5c07e4994 Mon Sep 17 00:00:00 2001 From: Aryabhatta Dey Date: Mon, 13 May 2024 09:36:01 +0530 Subject: [PATCH 1/2] Fix SyntaxError: invalid syntax in doc/fill_gpi.py --- doc/fill_gpi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/fill_gpi.py b/doc/fill_gpi.py index 500316ddda..12d7054b9e 100755 --- a/doc/fill_gpi.py +++ b/doc/fill_gpi.py @@ -66,7 +66,7 @@ def signature(func, name=None): Returns: a string representing its signature as would be written in code """ - args, varargs, varkw, defaults = inspect.getargspec(func) + args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations = inspect.getfullargspec(func) defaults = defaults or [] # If there are no defaults, set it to an empty list defaults = [repr(d) for d in defaults] # Type to get a useful string representing the default From 90a9e35a8d1bf786f2fc66a117a407484ec8c45d Mon Sep 17 00:00:00 2001 From: Aryabhatta Dey Date: Wed, 22 May 2024 09:21:27 +0530 Subject: [PATCH 2/2] Use _ to mark the new unused variables from the return value of getfullargspec instead of explicity naming them. --- doc/fill_gpi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/fill_gpi.py b/doc/fill_gpi.py index 12d7054b9e..b47bc3a16f 100755 --- a/doc/fill_gpi.py +++ b/doc/fill_gpi.py @@ -66,7 +66,7 @@ def signature(func, name=None): Returns: a string representing its signature as would be written in code """ - args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations = inspect.getfullargspec(func) + args, varargs, varkw, defaults, *_ = inspect.getfullargspec(func) defaults = defaults or [] # If there are no defaults, set it to an empty list defaults = [repr(d) for d in defaults] # Type to get a useful string representing the default