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>
This commit is contained in:
Topi Miettinen 2020-04-16 12:56:25 +03:00
parent acd45b66b4
commit fb120dd8df
No known key found for this signature in database
GPG Key ID: 87E1A51C590B0577
1 changed files with 2 additions and 2 deletions

View File

@ -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]