5163: Another crash in same editor.

svn: r21775
This commit is contained in:
Benny Malengier 2013-03-28 10:02:36 +00:00
parent ccb23bd7c4
commit f59b8fb7d8

View File

@ -1018,6 +1018,14 @@ class NameDisplay(object):
# flag that works in standard python format strings.
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
# 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