Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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.
  • Loading branch information
bfrascher committed Feb 16, 2019
commit 26afdd9eeee65f0633e7f1752ed31ec9d62dd73a
2 changes: 1 addition & 1 deletion bpython/inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def getfuncprops(func, f):
argspec = argspec + [list(), dict(), None]
argspec = ArgSpec(*argspec)
fprops = FuncProps(func, argspec, is_bound_method)
except (TypeError, KeyError):
except (TypeError, KeyError, ValueError):
with AttrCleaner(f):
argspec = getpydocspec(f, func)
if argspec is None:
Expand Down