]> gitweb.michael.orlitzky.com - djbdns-logparse.git/blobdiff - djbdns/tinydns.py
djbdns/{dnscache,tinydns}.py: don't clobber the global compile().
[djbdns-logparse.git] / djbdns / tinydns.py
index 52b06a4e338ea8acc2ce51da8ed90342b88ad80f..34cedef376c9829d2c668e2cb8c807cbe279301e 100644 (file)
@@ -1,4 +1,6 @@
-from re import compile
+# Don't clobber the global compile() with a named import.
+import re
+
 from typing import Optional
 from djbdns.common import *
 
@@ -13,7 +15,7 @@ hex4_pat = r'[0-9a-f]{4}'
 ip_pat = r'[0-9a-f]{8,32}'
 
 # The regex to match tinydns log lines.
-tinydns_log_re = compile(
+tinydns_log_re = re.compile(
     rf'({timestamp_pat}) ({ip_pat}):({hex4_pat}):({hex4_pat}) ([\+\-IC/]) ({hex4_pat}) (.*)'
 )