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 b4bef26 commit ae717e0Copy full SHA for ae717e0
bpython/inspection.py
@@ -219,7 +219,11 @@ def getargspec(func, f):
219
# Check if it's a real bound method or if it's implicitly calling __init__
220
# (i.e. FooClass(...) and not FooClass.__init__(...) -- the former would
221
# not take 'self', the latter would:
222
- func_name = getattr(f, '__name__', None)
+ try:
223
+ func_name = getattr(f, '__name__', None)
224
+ except:
225
+ # if calling foo.__name__ would result in an error
226
+ func_name = None
227
228
try:
229
is_bound_method = ((inspect.ismethod(f) and f.im_self is not None)
0 commit comments