From 1909744631033cba92f19433061e6a7c802d7766 Mon Sep 17 00:00:00 2001 From: Thomas Roth Date: Thu, 25 Feb 2010 17:45:37 +0100 Subject: [PATCH] Small improvement in regular expression compiler exception handling. --- libmproxy/filt.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libmproxy/filt.py b/libmproxy/filt.py index 1dba31537..482ba74bb 100644 --- a/libmproxy/filt.py +++ b/libmproxy/filt.py @@ -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():