Fix a regex clause that was totally wrong

This commit is contained in:
Dave Halter
2019-01-10 01:00:08 +01:00
parent 57320af6eb
commit 610a820799
2 changed files with 5 additions and 1 deletions

View File

@@ -388,7 +388,7 @@ class DiffParser(object):
# endmarker or another dedented code block.
typ, string, start_pos, prefix = next(tokens)
if '\n' in prefix or '\r' in prefix:
prefix = re.sub(r'(<=\n|\r)[^\n\r]+$', '', prefix)
prefix = re.sub(r'(?<=\n|\r)[^\n\r]+$', '', prefix)
else:
prefix = ''
yield PythonToken(