##// END OF EJS Templates
Display source code correctly for decorated functions....
Ben Edwards -
Show More
@@ -129,10 +129,13 b' def getsource(obj,is_binary=False):'
129 - is_binary: whether the object is known to come from a binary source.
129 - is_binary: whether the object is known to come from a binary source.
130 This implementation will skip returning any output for binary objects, but
130 This implementation will skip returning any output for binary objects, but
131 custom extractors may know how to meaningfully process them."""
131 custom extractors may know how to meaningfully process them."""
132
132
133 if is_binary:
133 if is_binary:
134 return None
134 return None
135 else:
135 else:
136 #get source if obj was decoratred with @decorator
137 if hasattr(obj,"__wrapped__"):
138 obj = obj.__wrapped__
136 try:
139 try:
137 src = inspect.getsource(obj)
140 src = inspect.getsource(obj)
138 except TypeError:
141 except TypeError:
General Comments 0
You need to be logged in to leave comments. Login now