From: Joseph Sutton Date: Tue, 23 May 2023 04:37:30 +0000 (+1200) Subject: tests/auth_log: Pre-compile GUID regex X-Git-Tag: talloc-2.4.1~554 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72d5a5a33bcf504a2095d2c771737d8feea03d26;p=thirdparty%2Fsamba.git tests/auth_log: Pre-compile GUID regex Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/auth_log_base.py b/python/samba/tests/auth_log_base.py index ebe9c3a124a..bc903168775 100644 --- a/python/samba/tests/auth_log_base.py +++ b/python/samba/tests/auth_log_base.py @@ -147,10 +147,11 @@ class AuthLogTestBase(samba.tests.TestCase): return list(filter(is_not_netlogon, messages)) - GUID_RE = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + GUID_RE = re.compile( + "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}") # # Is the supplied GUID string correctly formatted # def is_guid(self, guid): - return re.match(self.GUID_RE, guid) + return self.GUID_RE.match(guid)