diff options
author | Ned Deily <nad@acm.org> | 2011-09-14 21:56:32 (GMT) |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2011-09-14 21:56:32 (GMT) |
commit | 86ca04ccc72820b3233f0010ad4c6f91208a7e18 (patch) | |
tree | f543737135dd972ef95e79fb93f31159463e40eb /Lib/idlelib/PyShell.py | |
parent | 02ba6c291615616cc1dfcacd575eb52fafc2fb43 (diff) | |
parent | 79746426c439a8a163d95381ffffa1b2fd34348e (diff) | |
download | cpython-86ca04ccc72820b3233f0010ad4c6f91208a7e18.zip cpython-86ca04ccc72820b3233f0010ad4c6f91208a7e18.tar.gz cpython-86ca04ccc72820b3233f0010ad4c6f91208a7e18.tar.bz2 |
Issue #9871: Prevent IDLE 3 crash when given byte stings
with invalid hex escape sequences, like b'\x0'.
(Original patch by Claudiu Popa.)
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rw-r--r-- | Lib/idlelib/PyShell.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index da74729..43e08f2 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -643,9 +643,9 @@ class ModifiedInterpreter(InteractiveInterpreter): text = tkconsole.text text.tag_remove("ERROR", "1.0", "end") type, value, tb = sys.exc_info() - msg = value.msg or "<no detail available>" - lineno = value.lineno or 1 - offset = value.offset or 0 + msg = getattr(value, 'msg', '') or value or "<no detail available>" + lineno = getattr(value, 'lineno', '') or 1 + offset = getattr(value, 'offset', '') or 0 if offset == 0: lineno += 1 #mark end of offending line if lineno == 1: |