Small improvement in regular expression compiler exception handling.

This commit is contained in:
Thomas Roth 2010-02-25 17:45:37 +01:00
parent 000196fe21
commit 1909744631
1 changed files with 2 additions and 6 deletions

View File

@ -76,7 +76,7 @@ class _Rex(_Action):
try:
self.re = re.compile(self.expr)
except:
self.re = False
self = None
def _check_content_type(expr, o):
val = o.headers.get("content-type")
@ -188,11 +188,7 @@ class FUrl(_Rex):
def make(klass, s, loc, toks):
if len(toks) > 1:
toks = toks[1:]
ret_klass = klass(*toks)
if ret_klass.re:
return ret_klass
else:
return False
return klass(*toks)
def __call__(self, o):
if o.is_response():