Permalink
Browse files

Address self reference object for getsource

  • Loading branch information...
1 parent 981d252 commit 63c5ec8f5b7ee0ac46ffc413ed519f4cbfdcd881 Ben Edwards committed Jul 14, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 IPython/core/oinspect.py
View
2 IPython/core/oinspect.py
@@ -135,6 +135,8 @@ def getsource(obj,is_binary=False):
else:
#get source if obj was decoratred with @decorator
while hasattr(obj,"__wrapped__"):
+ if obj is obj.__wrapped__:
+ break
obj = obj.__wrapped__
try:
src = inspect.getsource(obj)

0 comments on commit 63c5ec8

Please sign in to comment.