diff --git a/httpretty/core.py b/httpretty/core.py index 2472fb9..c7d739b 100644 --- a/httpretty/core.py +++ b/httpretty/core.py @@ -802,8 +802,9 @@ class URIMatcher(object): def __init__(self, uri, entries, match_querystring=False, priority=0): self._match_querystring = match_querystring # CPython, Jython - if type(uri).__name__ in ('SRE_Pattern', - 'org.python.modules.sre.PatternObject'): + regex_types = ('SRE_Pattern', 'org.python.modules.sre.PatternObject') + is_regex = type(uri).__name__ in regex_types + if is_regex: self.regex = uri result = urlsplit(uri.pattern) if result.scheme == 'https':