summaryrefslogtreecommitdiffstats
path: root/Mac/Tools
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2001-06-21 21:52:15 (GMT)
committerJust van Rossum <just@letterror.com>2001-06-21 21:52:15 (GMT)
commit67456e841c5057772d2bf394aba6ad7e8c389ce0 (patch)
treeef1aff41bfd7e5038a4bebba61b4396e5d83fed2 /Mac/Tools
parentb10eb84f291031bd45d62302ec2c98be89241e02 (diff)
downloadcpython-67456e841c5057772d2bf394aba6ad7e8c389ce0.zip
cpython-67456e841c5057772d2bf394aba6ad7e8c389ce0.tar.gz
cpython-67456e841c5057772d2bf394aba6ad7e8c389ce0.tar.bz2
don't blow up when the charno SyntaxError value is None
Diffstat (limited to 'Mac/Tools')
-rw-r--r--Mac/Tools/IDE/Wtraceback.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Mac/Tools/IDE/Wtraceback.py b/Mac/Tools/IDE/Wtraceback.py
index 2637cc6..4960ad0 100644
--- a/Mac/Tools/IDE/Wtraceback.py
+++ b/Mac/Tools/IDE/Wtraceback.py
@@ -55,7 +55,7 @@ class TraceBack:
filename = "<unknown>"
if filename and os.path.exists(filename):
filename = os.path.split(filename)[1]
- if lineno:
+ if lineno and charno is not None:
charno = charno - 1
text = str(value) + '\rFile: "' + str(filename) + '", line ' + str(lineno) + '\r\r' + line[:charno] + "\xa5" + line[charno:-1]
else:
@@ -84,6 +84,8 @@ class TraceBack:
filename = "<unknown>"
self.syntaxclose()
if lineno:
+ if charno is None:
+ charno = 1
W.getapplication().openscript(filename, lineno, charno - 1)
else:
W.getapplication().openscript(filename)