From f5beb3e2f7a773b6cd13ee872718e2a72e18334a Mon Sep 17 00:00:00 2001 From: David White Date: Sat, 17 May 2025 14:10:48 +0100 Subject: [PATCH 1/2] Fix syntax warning on python 3.12 --- iptc/ip4tc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iptc/ip4tc.py b/iptc/ip4tc.py index 90f5ee7..c4ba58c 100644 --- a/iptc/ip4tc.py +++ b/iptc/ip4tc.py @@ -262,7 +262,7 @@ class iptc(object): class IPTCModule(object): """Superclass for Match and Target.""" pattern = re.compile( - '\s*(!)?\s*--([-\w]+)\s+(!)?\s*"?([^"]*?)"?(?=\s*(?:!?\s*--|$))') + r'\s*(!)?\s*--([-\w]+)\s+(!)?\s*"?([^"]*?)"?(?=\s*(?:!?\s*--|$))') def __init__(self): self._name = None From fc15a4a85b9a175a45052c4f0dda9b6dc6dab44c Mon Sep 17 00:00:00 2001 From: David White Date: Sat, 17 May 2025 14:52:17 +0100 Subject: [PATCH 2/2] Add raw string for xtables regex --- iptc/xtables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iptc/xtables.py b/iptc/xtables.py index 024779c..1674cc4 100644 --- a/iptc/xtables.py +++ b/iptc/xtables.py @@ -805,7 +805,7 @@ class xtables_target(ct.Union): _xtables_libdir = os.getenv("XTABLES_LIBDIR") if _xtables_libdir is None: import re - ldconfig_path_regex = re.compile('^(/.*):($| \(.*\)$)') + ldconfig_path_regex = re.compile(r'^(/.*):($| \(.*\)$)') import subprocess ldconfig = subprocess.Popen( ('/sbin/ldconfig', '-N', '-v'),