Skip to content

Commit 44911dd

Browse files
Merge pull request #372 from SoftwareUnderstanding/dev
Dev
2 parents fa3ccf1 + f39fb32 commit 44911dd

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

inspect4py/cli.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,10 +1057,9 @@ def _get_ids(self, elt):
10571057
:param ast.node elt: AST node
10581058
:return list: list of identifiers
10591059
"""
1060-
#print("--- DEBUG!!! %s" %ast.unparse(elt))
1061-
# old code --> if isinstance(elt, (ast.List,)) or isinstance(elt, (ast.Tuple,)):
1060+
## Modification of the function
1061+
## to catch the source code, in case if what we return is not a variable.
10621062
if isinstance(elt, (ast.Tuple,)):
1063-
# old code --> [x.id for x in elt.elts if isinstance(x, (ast.Name,))]
10641063
# For tuple or list get id of each item if item is a Name
10651064
rd=[]
10661065
for x in elt.elts:

test/test_files/test_basic/test_basic_function_return.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def foo9(arg1, arg2):
4242
def foo10(arg1, arg2):
4343
return 5
4444

45-
def foo10(arg1, arg2):
45+
46+
def foo11(arg1, arg2):
47+
#last test
4648
a=3
4749
b=[0,1,2]
4850
return a,b

0 commit comments

Comments
 (0)