Don't use invalid escape sequences in regex, see https://github.com/davidhalter/jedi-vim/issues/843

This commit is contained in:
Dave Halter
2018-07-12 08:54:03 +02:00
parent 87d7c59c6e
commit 71cea7200b
5 changed files with 9 additions and 9 deletions

View File

@@ -536,9 +536,9 @@ class Definition(BaseDefinition):
# here.
txt = definition.get_code(include_prefix=False)
# Delete comments:
txt = re.sub('#[^\n]+\n', ' ', txt)
txt = re.sub(r'#[^\n]+\n', ' ', txt)
# Delete multi spaces/newlines
txt = re.sub('\s+', ' ', txt).strip()
txt = re.sub(r'\s+', ' ', txt).strip()
return txt
@property