From: Just van Rossum Date: Thu, 21 Jun 2001 21:52:15 +0000 (+0000) Subject: don't blow up when the charno SyntaxError value is None X-Git-Tag: v2.2a3~1479 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67456e841c5057772d2bf394aba6ad7e8c389ce0;p=thirdparty%2FPython%2Fcpython.git don't blow up when the charno SyntaxError value is None --- diff --git a/Mac/Tools/IDE/Wtraceback.py b/Mac/Tools/IDE/Wtraceback.py index 2637cc693e02..4960ad08d9ac 100644 --- a/Mac/Tools/IDE/Wtraceback.py +++ b/Mac/Tools/IDE/Wtraceback.py @@ -55,7 +55,7 @@ class TraceBack: filename = "" 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 = "" self.syntaxclose() if lineno: + if charno is None: + charno = 1 W.getapplication().openscript(filename, lineno, charno - 1) else: W.getapplication().openscript(filename)