Skip to content

Commit 015a9c4

Browse files
author
Philip Guo
committed
slightly improved robustness
1 parent 325e79f commit 015a9c4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

v3/pg_encoder.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,16 @@ def encode(self, dat, get_parent):
205205
printed_args.append('**' + argspec.keywords)
206206

207207
func_name = get_name(dat)
208-
pretty_name = func_name + '(' + ', '.join(printed_args) + ')'
208+
209+
pretty_name = func_name
210+
211+
# sometimes might fail for, say, <genexpr>, so just ignore
212+
# failures for now ...
213+
try:
214+
pretty_name += '(' + ', '.join(printed_args) + ')'
215+
except TypeError:
216+
pass
217+
209218
encoded_val = ['FUNCTION', pretty_name, None]
210219
if get_parent:
211220
enclosing_frame_id = get_parent(dat)

0 commit comments

Comments
 (0)