Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix(checker): use raw string for all regex
Browse files Browse the repository at this point in the history
Avoid DeprecationWarning ("invalid escape sequence").
  • Loading branch information
johanfleury committed Oct 25, 2019
1 parent b785749 commit 3fe96ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pydocstyle/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,15 +977,15 @@ def is_ascii(string):

def leading_space(string):
"""Return any leading space from `string`."""
return re('\s*').match(string).group()
return re(r'\s*').match(string).group()


def get_leading_words(line):
"""Return any leading set of words from `line`.
For example, if `line` is " Hello world!!!", returns "Hello world".
"""
result = re("[\w ]+").match(line.strip())
result = re(r"[\w ]+").match(line.strip())
if result is not None:
return result.group()

Expand Down

0 comments on commit 3fe96ec

Please sign in to comment.