Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r48659:0dedcb956aa5 Date: 2011-11-02 15:57 +0100 http://bitbucket.org/pypy/pypy/changeset/0dedcb956aa5/
Log: Try never to crash when inspect.getsource() fails. diff --git a/pypy/tool/sourcetools.py b/pypy/tool/sourcetools.py --- a/pypy/tool/sourcetools.py +++ b/pypy/tool/sourcetools.py @@ -107,10 +107,8 @@ else: try: src = inspect.getsource(object) - except IOError: - return None - except IndentationError: - return None + except Exception: # catch IOError, IndentationError, and also rarely + return None # some other exceptions like IndexError if hasattr(name, "__sourceargs__"): return src % name.__sourceargs__ return src _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit