aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <tweek@google.com>2020-09-16 14:51:36 +0200
committerThiƩbaud Weksteen <tweek@google.com>2020-09-16 15:54:44 +0200
commit573d316aa2a01cb56c8c707f7fc655e6ecc1db2a (patch)
tree0979344bbadbb4084f6053c5dd3f798fc20f82de
parent5be91ca1c2f1195f6123d5eda3228a5b9798478d (diff)
downloadrepohooks-573d316aa2a01cb56c8c707f7fc655e6ecc1db2a.tar.gz
hooks: support Python 3.6 for ExclusionScope
re.Pattern was only introduced in Python 3.7. Test: ./pre-upload Bug: 168593718 Change-Id: I9dc685a8d1863808d9c475539a8f1fdbd96474d0
-rw-r--r--rh/hooks.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rh/hooks.py b/rh/hooks.py
index b5350cd..491da91 100644
--- a/rh/hooks.py
+++ b/rh/hooks.py
@@ -171,7 +171,7 @@ class ExclusionScope(object):
proj_dir: The relative path of the project.
"""
for exclusion_path in self._scope:
- if isinstance(exclusion_path, re.Pattern):
+ if hasattr(exclusion_path, 'match'):
if exclusion_path.match(proj_dir):
return True
elif fnmatch.fnmatch(proj_dir, exclusion_path):