We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efa8b04 commit ac6d3a4Copy full SHA for ac6d3a4
stackprinter/utils.py
@@ -32,20 +32,12 @@ def inspect_callable(f):
32
else:
33
return None, None, None, None
34
35
- try:
36
- qname = f.__qualname__
37
- except AttributeError:
38
- qname = None
39
-
40
41
- filepath = code.co_filename
42
43
- filepath = None
44
45
46
- ln = code.co_firstlineno
47
48
- ln = None
+ qname = getattr(f, '__qualname__', None)
+
+ # under pypy, builtin code object (like: [].append.__func__.__code__)
+ # have no co_filename and co_firstlineno
+ filepath = getattr(code, 'co_filename', None)
+ ln = getattr(code, 'co_firstlineno', None)
49
50
return qname, filepath, owner, ln
51
0 commit comments