don't blow up when the charno SyntaxError value is None
This commit is contained in:
parent
b10eb84f29
commit
67456e841c
|
@ -55,7 +55,7 @@ class TraceBack:
|
||||||
filename = "<unknown>"
|
filename = "<unknown>"
|
||||||
if filename and os.path.exists(filename):
|
if filename and os.path.exists(filename):
|
||||||
filename = os.path.split(filename)[1]
|
filename = os.path.split(filename)[1]
|
||||||
if lineno:
|
if lineno and charno is not None:
|
||||||
charno = charno - 1
|
charno = charno - 1
|
||||||
text = str(value) + '\rFile: "' + str(filename) + '", line ' + str(lineno) + '\r\r' + line[:charno] + "\xa5" + line[charno:-1]
|
text = str(value) + '\rFile: "' + str(filename) + '", line ' + str(lineno) + '\r\r' + line[:charno] + "\xa5" + line[charno:-1]
|
||||||
else:
|
else:
|
||||||
|
@ -84,6 +84,8 @@ class TraceBack:
|
||||||
filename = "<unknown>"
|
filename = "<unknown>"
|
||||||
self.syntaxclose()
|
self.syntaxclose()
|
||||||
if lineno:
|
if lineno:
|
||||||
|
if charno is None:
|
||||||
|
charno = 1
|
||||||
W.getapplication().openscript(filename, lineno, charno - 1)
|
W.getapplication().openscript(filename, lineno, charno - 1)
|
||||||
else:
|
else:
|
||||||
W.getapplication().openscript(filename)
|
W.getapplication().openscript(filename)
|
||||||
|
|
Loading…
Reference in New Issue