Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
+ reorder guard statements
  • Loading branch information
skirpichev committed Aug 18, 2024
commit 1aeabf2ce42d01fbf3c76daef8d794a18ea39149
2 changes: 1 addition & 1 deletion Lib/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _showtraceback(self, typ, value, tb, source):
sys.last_traceback = tb
value = value.with_traceback(tb)
# Set the line of text that the exception refers to
if source and not value.text and typ is SyntaxError:
if source and typ is SyntaxError and not value.text:
value.text = source.splitlines()[value.lineno - 1]
Comment thread
skirpichev marked this conversation as resolved.
Outdated
sys.last_exc = sys.last_value = value
if sys.excepthook is sys.__excepthook__:
Expand Down