Skip to content

Commit cd6886a

Browse files
bfraschersebastinas
authored andcommitted
Catch function signature inspection errors for built-in types
Some built-in functions (e.g. `map`) can't be inspected with `inspect.getargspec`, `inspect.getfullargspec` or `inspect.signature`. The exceptions from `inspect.getargspec` and `inspect.getfullargspec` are all caught in the code, but `inspect.signature` raises a `ValueError` instead of a `TypeError`. This exception is now also caught.
1 parent 0a5bd6e commit cd6886a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bpython/inspection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def getfuncprops(func, f):
259259
argspec = argspec + [list(), dict(), None]
260260
argspec = ArgSpec(*argspec)
261261
fprops = FuncProps(func, argspec, is_bound_method)
262-
except (TypeError, KeyError):
262+
except (TypeError, KeyError, ValueError):
263263
with AttrCleaner(f):
264264
argspec = getpydocspec(f, func)
265265
if argspec is None:

0 commit comments

Comments
 (0)