Fix bug in error detection code, where a zero-length string was causing a traceback

Fixes #5064
This commit is contained in:
James Cammarata 2013-11-27 11:57:15 -06:00
parent 30948ae0dc
commit 1f80aa768a

View file

@ -403,7 +403,7 @@ Or:
match = True
elif middle.startswith('"') and not middle.endswith('"'):
match = True
if middle[0] in [ '"', "'" ] and middle[-1] in [ '"', "'" ] and probline.count("'") > 2 or probline.count("'") > 2:
if len(middle) > 0 and middle[0] in [ '"', "'" ] and middle[-1] in [ '"', "'" ] and probline.count("'") > 2 or probline.count("'") > 2:
unbalanced = True
if match:
msg = msg + """