From c431a74d9e781946f94fcb30bcd61efebe344651 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 27 May 2010 11:52:18 +0000 Subject: [PATCH] minor fix/adjustment regarding getCompiledRegex --- lib/core/common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 113cba5d6..6992420a5 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1277,15 +1277,15 @@ def getGoodSamaritanParameters(part, prevValue, originalCharset): else: return None, None, originalCharset -def getCompiledRegex(regex, args=()): +def getCompiledRegex(regex, *args): """ Returns compiled regular expression and stores it in cache for further usage """ - if regex in __compiledRegularExpressions: - return __compiledRegularExpressions[regex] + if (regex, args) in __compiledRegularExpressions: + return __compiledRegularExpressions[(regex, args)] else: retVal = re.compile(regex, *args) - __compiledRegularExpressions[regex] = retVal + __compiledRegularExpressions[(regex, args)] = retVal return retVal def getPartRun():