Merge pull request #262 from darjus-amzn/master

Make Jython SRE_Pattern object recognized
This commit is contained in:
Gabriel Falcão 2016-01-12 03:29:46 -02:00
commit 7e57dee713
1 changed files with 3 additions and 1 deletions

View File

@ -801,7 +801,9 @@ class URIMatcher(object):
def __init__(self, uri, entries, match_querystring=False, priority=0):
self._match_querystring = match_querystring
if type(uri).__name__ == 'SRE_Pattern':
# CPython, Jython
if type(uri).__name__ in ('SRE_Pattern',
'org.python.modules.sre.PatternObject'):
self.regex = uri
result = urlsplit(uri.pattern)
if result.scheme == 'https':