Make string contents nongreedy.

This commit is contained in:
Georg Brandl 2010-07-28 19:15:04 +02:00
parent 98b6073a7e
commit 3002eb391f

View File

@ -208,6 +208,6 @@ def write_file(name, contents, encoding=None):
def sprint(*args):
sys.stderr.write(' '.join(map(str, args)) + '\n')
_unicode_literals_re = re.compile(r'u(".*")|u(\'.*\')')
_unicode_literals_re = re.compile(r'u(".*?")|u(\'.*?\')')
def remove_unicode_literals(s):
return _unicode_literals_re.sub(lambda x: x.group(1) or x.group(2), s)