##// END OF EJS Templates
Simplify oinspect.getdoc....
Antony Lee -
Show More
@@ -123,18 +123,11 b' def getdoc(obj):'
123 except Exception:
123 except Exception:
124 pass
124 pass
125 else:
125 else:
126 # if we get extra info, we add it to the normal docstring.
127 if isinstance(ds, str):
126 if isinstance(ds, str):
128 return inspect.cleandoc(ds)
127 return inspect.cleandoc(ds)
129 try:
128 docstr = inspect.getdoc(obj)
130 docstr = inspect.getdoc(obj)
129 encoding = get_encoding(obj)
131 encoding = get_encoding(obj)
130 return py3compat.cast_unicode(docstr, encoding=encoding)
132 return py3compat.cast_unicode(docstr, encoding=encoding)
133 except Exception:
134 # Harden against an inspect failure, which can occur with
135 # extensions modules.
136 raise
137 return None
138
131
139
132
140 def getsource(obj, oname=''):
133 def getsource(obj, oname=''):
General Comments 0
You need to be logged in to leave comments. Login now