diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-01-26 16:06:24 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-01-26 16:09:41 +0100 |
commit | e7b20e89546857635e28cc05cc7cb4ab8cbd6ee7 (patch) | |
tree | 5066d8f09913f766b8f8195f3e2c2a01fcbee767 /pym/gentoolkit/helpers.py | |
parent | eshowkw: Add alpha to ~arch-only (diff) | |
download | gentoolkit-e7b20e89546857635e28cc05cc7cb4ab8cbd6ee7.tar.gz gentoolkit-e7b20e89546857635e28cc05cc7cb4ab8cbd6ee7.tar.bz2 gentoolkit-e7b20e89546857635e28cc05cc7cb4ab8cbd6ee7.zip |
Pass raw strings for regexp to fix DeprecationWarnings
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'pym/gentoolkit/helpers.py')
-rw-r--r-- | pym/gentoolkit/helpers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py index 40235d5..a551550 100644 --- a/pym/gentoolkit/helpers.py +++ b/pym/gentoolkit/helpers.py @@ -257,7 +257,7 @@ class FileOwner(object): raise errors.GentoolkitInvalidRegex(err) use_match = False - if ((self.is_regex or query_re_string.startswith('^\/')) + if ((self.is_regex or query_re_string.startswith(r'^\/')) and '|' not in query_re_string ): # If we were passed a regex or a single path starting with root, # we can use re.match, else use re.search. @@ -350,7 +350,7 @@ class FileOwner(object): else: result = [] # Trim trailing and multiple slashes from queries - slashes = re.compile('/+') + slashes = re.compile(r'/+') queries = self.expand_abspaths(queries) queries = self.extend_realpaths(queries) for query in queries: |