##// END OF EJS Templates
Unicode fix for docstrings in pinfo2 magic...
Jörgen Stenarson -
Show More
@@ -138,10 +138,7 b' def getdoc(obj):'
138 try:
138 try:
139 docstr = inspect.getdoc(obj)
139 docstr = inspect.getdoc(obj)
140 encoding = get_encoding(obj)
140 encoding = get_encoding(obj)
141 if encoding:
141 return py3compat.cast_unicode(docstr, encoding=encoding)
142 return py3compat.cast_unicode(docstr, encoding=encoding)
143 else:
144 return docstr
145 except Exception:
142 except Exception:
146 # Harden against an inspect failure, which can occur with
143 # Harden against an inspect failure, which can occur with
147 # SWIG-wrapped extensions.
144 # SWIG-wrapped extensions.
@@ -176,7 +173,8 b' def getsource(obj,is_binary=False):'
176 except TypeError:
173 except TypeError:
177 if hasattr(obj,'__class__'):
174 if hasattr(obj,'__class__'):
178 src = inspect.getsource(obj.__class__)
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 def getargspec(obj):
179 def getargspec(obj):
182 """Get the names and default values of a function's arguments.
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