Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better check for missing source in Inspector.info()

  • Loading branch information...
commit ec4f4ff6ae53180eaf30877801e313b2053425dd 1 parent 7ee70a7
@takluyver authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 IPython/core/oinspect.py
View
9 IPython/core/oinspect.py
@@ -571,7 +571,7 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
# Flush the source cache because inspect can return out-of-date
# source
linecache.checkcache()
- source_success = False
+ source = None
try:
try:
src = getsource(obj,binary_file)
@@ -581,10 +581,11 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
if src is not None:
source = self.format(src)
out['source'] = source.rstrip()
- source_success = True
except Exception:
- if ds:
- out['docstring'] = ds
+ pass
+
+ if ds and source is None:
+ out['docstring'] = ds
# Constructor docstring for classes
Please sign in to comment.
Something went wrong with that request. Please try again.