From f8159d0be003ebd9baefcb76f07375fccc6f5a13 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 29 Jun 2018 09:56:00 +0200 Subject: [PATCH] Pythhon3.7: re module has no re._pattern_type Signed-off-by: Christian Heimes Reviewed-By: Alexander Bokovoy --- ipatests/test_util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ipatests/test_util.py b/ipatests/test_util.py index 0460588d1..078c46294 100644 --- a/ipatests/test_util.py +++ b/ipatests/test_util.py @@ -46,6 +46,9 @@ else: yield_fixture = pytest.fixture +pattern_type = type(re.compile("")) + + class Prop(object): def __init__(self, *ops): self.__ops = frozenset(ops) @@ -83,13 +86,13 @@ class test_Fuzzy(object): assert inst.regex == '(foo|bar)' assert inst.type is unicode assert inst.test is None - assert isinstance(inst.re, re._pattern_type) + assert isinstance(inst.re, pattern_type) inst = self.klass('(foo|bar)', type=str) assert inst.regex == '(foo|bar)' assert inst.type is str assert inst.test is None - assert isinstance(inst.re, re._pattern_type) + assert isinstance(inst.re, pattern_type) t = lambda other: other > 500