Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e74bbd2

Browse filesBrowse files
committed
Move if py3 to module level
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent 24e5c69 commit e74bbd2
Copy full SHA for e74bbd2

1 file changed

+7-4Lines changed: 7 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/inspection.py‎

Copy file name to clipboardExpand all lines: bpython/inspection.py
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,11 @@ def get_encoding_file(fname):
286286
return 'ascii'
287287

288288

289-
def get_source_unicode(obj):
290-
"""Returns a decoded source of object"""
291-
if py3:
289+
if py3:
290+
def get_source_unicode(obj):
291+
"""Returns a decoded source of object"""
292292
return inspect.getsource(obj)
293-
return inspect.getsource(obj).decode(get_encoding(obj))
293+
else:
294+
def get_source_unicode(obj):
295+
"""Returns a decoded source of object"""
296+
return inspect.getsource(obj).decode(get_encoding(obj))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.