We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24e5c69 commit e74bbd2Copy full SHA for e74bbd2
bpython/inspection.py
@@ -286,8 +286,11 @@ def get_encoding_file(fname):
286
return 'ascii'
287
288
289
-def get_source_unicode(obj):
290
- """Returns a decoded source of object"""
291
- if py3:
+if py3:
+ def get_source_unicode(obj):
+ """Returns a decoded source of object"""
292
return inspect.getsource(obj)
293
- return inspect.getsource(obj).decode(get_encoding(obj))
+else:
294
295
296
+ return inspect.getsource(obj).decode(get_encoding(obj))
0 commit comments