diff options
author | Pavel Labath <pavel@labath.sk> | 2018-12-27 15:16:37 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2018-12-27 15:16:37 +0000 |
commit | 9294a2669eb6124e129a2fb72cdd6e8a2b3e9312 (patch) | |
tree | ba3e580dbe9f99a84c6cd2c9c6bb96d5709a3b9a /lldb/packages/Python/lldbsuite/test | |
parent | ddd06821c466bb4c2b414067d6a3e924d001a092 (diff) | |
download | bcm5719-llvm-9294a2669eb6124e129a2fb72cdd6e8a2b3e9312.tar.gz bcm5719-llvm-9294a2669eb6124e129a2fb72cdd6e8a2b3e9312.zip |
Fix tests for python 3.7
python 3.7 removes re._pattern_type. Fix the one place where we were
depending on the type of regular expressions to compute the type
dynamically.
llvm-svn: 350093
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/decorators.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index cacd718f783..2458a6f8745 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -74,13 +74,14 @@ def _check_expected_version(comparison, expected, actual): LooseVersion(expected_str)) +_re_pattern_type = type(re.compile('')) def _match_decorator_property(expected, actual): if actual is None or expected is None: return True if isinstance(expected, no_match): return not _match_decorator_property(expected.item, actual) - elif isinstance(expected, (re._pattern_type,) + six.string_types): + elif isinstance(expected, (_re_pattern_type,) + six.string_types): return re.search(expected, actual) is not None elif hasattr(expected, "__iter__"): return any([x is not None and _match_decorator_property(x, actual) |