Browse files

Merge branch '__wrapped__'

closes gh-578
  • Loading branch information...
2 parents c98cc61 + 32cebfc commit fc0a73ff395c3e03e81465d94118d771fb936bb6 @minrk minrk committed Jul 18, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 IPython/core/oinspect.py
View
5 IPython/core/oinspect.py
@@ -129,10 +129,13 @@ def getsource(obj,is_binary=False):
- is_binary: whether the object is known to come from a binary source.
This implementation will skip returning any output for binary objects, but
custom extractors may know how to meaningfully process them."""
-
+
if is_binary:
return None
else:
+ # get source if obj was decorated with @decorator
+ if hasattr(obj,"__wrapped__"):
+ obj = obj.__wrapped__
try:
src = inspect.getsource(obj)
except TypeError:

0 comments on commit fc0a73f

Please sign in to comment.