5163: Another crash in same editor.

svn: r21776
This commit is contained in:
Benny Malengier 2013-03-28 10:02:40 +00:00
parent b4c225fc35
commit 4260777605

View File

@ -1018,6 +1018,14 @@ class NameDisplay(object):
# flag that works in standard python format strings. # flag that works in standard python format strings.
new_fmt = re.sub("|".join(patterns), "%s", new_fmt) new_fmt = re.sub("|".join(patterns), "%s", new_fmt)
# replace special meaning codes we need to have verbatim in output
if (len(new_fmt) > 2 and new_fmt[0] == new_fmt[-1] == '"'):
new_fmt = new_fmt.replace('\\', r'\\')
new_fmt = new_fmt[1:-1].replace('"', r'\"')
else:
new_fmt = new_fmt.replace('\\', r'\\')
new_fmt = new_fmt.replace('"', '\\\"')
# find each format flag in the original format string # find each format flag in the original format string
# for each one we find the variable name that is needed to # for each one we find the variable name that is needed to
# replace it and add this to a list. This list will be used to # replace it and add this to a list. This list will be used to