Show More
@@ -138,10 +138,7 b' def getdoc(obj):' | |||
|
138 | 138 | try: |
|
139 | 139 | docstr = inspect.getdoc(obj) |
|
140 | 140 | encoding = get_encoding(obj) |
|
141 | if encoding: | |
|
142 | return py3compat.cast_unicode(docstr, encoding=encoding) | |
|
143 | else: | |
|
144 | return docstr | |
|
141 | return py3compat.cast_unicode(docstr, encoding=encoding) | |
|
145 | 142 | except Exception: |
|
146 | 143 | # Harden against an inspect failure, which can occur with |
|
147 | 144 | # SWIG-wrapped extensions. |
@@ -176,7 +173,8 b' def getsource(obj,is_binary=False):' | |||
|
176 | 173 | except TypeError: |
|
177 | 174 | if hasattr(obj,'__class__'): |
|
178 | 175 | src = inspect.getsource(obj.__class__) |
|
179 | return cast_unicode(src) | |
|
176 | encoding = get_encoding(obj) | |
|
177 | return cast_unicode(src, encoding=encoding) | |
|
180 | 178 | |
|
181 | 179 | def getargspec(obj): |
|
182 | 180 | """Get the names and default values of a function's arguments. |
General Comments 0
You need to be logged in to leave comments.
Login now