diff options
author | Topi Miettinen <toiwoton@gmail.com> | 2020-04-16 12:56:25 +0300 |
---|---|---|
committer | Jason Zaman <perfinion@gentoo.org> | 2020-08-09 19:58:44 -0700 |
commit | 019e02c6bf3b5815cbb95a50621e935dcee60bbc (patch) | |
tree | f0e9981860a15271dbea0dba76ec25e3592238c5 /support | |
parent | fix require from 5b78c1c86bedf322fa6a08e5d68e7e8a6b85f026 (diff) | |
download | hardened-refpolicy-019e02c6bf3b5815cbb95a50621e935dcee60bbc.tar.gz hardened-refpolicy-019e02c6bf3b5815cbb95a50621e935dcee60bbc.tar.bz2 hardened-refpolicy-019e02c6bf3b5815cbb95a50621e935dcee60bbc.zip |
Python string fix
Use raw string constants to avoid errors from python3.8:
NETPORT = re.compile("^network_port\(\s*\w+\s*(\s*,\s*\w+\s*,\s*\w+\s*,\s*\w+\s*)+\s*\)\s*(#|$)")
^
SyntaxError: invalid escape sequence \(
Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
Signed-off-by: Jason Zaman <perfinion@gentoo.org>
Diffstat (limited to 'support')
-rw-r--r-- | support/gennetfilter.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/support/gennetfilter.py b/support/gennetfilter.py index 7c9a85c7d..0912eb757 100644 --- a/support/gennetfilter.py +++ b/support/gennetfilter.py @@ -9,7 +9,7 @@ import sys,getopt,re -NETPORT = re.compile("^network_port\(\s*\w+\s*(\s*,\s*\w+\s*,\s*\w+\s*,\s*\w+\s*)+\s*\)\s*(#|$)") +NETPORT = re.compile(r"^network_port\(\s*\w+\s*(\s*,\s*\w+\s*,\s*\w+\s*,\s*\w+\s*)+\s*\)\s*(#|$)") DEFAULT_INPUT_PACKET = "server_packet_t" DEFAULT_OUTPUT_PACKET = "client_packet_t" @@ -101,7 +101,7 @@ def parse_corenet(file_name): # parse out the parameters openparen = corenet_line.find('(')+1 closeparen = corenet_line.find(')',openparen) - parms = re.split('\W+',corenet_line[openparen:closeparen]) + parms = re.split(r'\W+',corenet_line[openparen:closeparen]) name = parms[0] del parms[0] |