3911: Crash because of syntax error in name format; fixed having to escape double-quotes, and removed them if empty

svn: r15324
This commit is contained in:
Doug Blank 2010-05-05 03:56:18 +00:00
parent 053efc5f75
commit 0c270f4862

View File

@ -393,11 +393,14 @@ class NameDisplay(object):
]
format_str = format_str[1:]
else:
patterns = [",\W*\(%(" + ("|".join(codes)) + ")\)", # ,\W*(%s)
",\W*%(" + ("|".join(codes)) + ")", # ,\W*%s
"\(%(" + ("|".join(codes)) + ")\)", # (%s)
"%(" + ("|".join(codes)) + ")", # %s
]
patterns = [
",\W*\"%(" + ("|".join(codes)) + ")\"", # ,\W*"%s"
",\W*\(%(" + ("|".join(codes)) + ")\)", # ,\W*(%s)
",\W*%(" + ("|".join(codes)) + ")", # ,\W*%s
"\"%(" + ("|".join(codes)) + ")\"", # "%s"
"\(%(" + ("|".join(codes)) + ")\)", # (%s)
"%(" + ("|".join(codes)) + ")", # %s
]
new_fmt = format_str
# replace the specific format string flags with a