mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Use raw strings for regexs containing escapes
In Python 3.12, these invalid escape sequences emit SyntaxWarnings, and will emit SyntaxErrors in a future release. Found using: grep '[^r]["'\''].*\\[^rn\\x0t"]' $(grep -rl '^#!.*python')
This commit is contained in:
@@ -144,7 +144,7 @@ sslProto = open(ff('security/nss/lib/ssl/sslproto.h'), 'r')
|
||||
sslProtoD = {}
|
||||
|
||||
for line in sslProto:
|
||||
m = re.match('#define\s+(\S+)\s+(\S+)', line)
|
||||
m = re.match(r'#define\s+(\S+)\s+(\S+)', line)
|
||||
if m:
|
||||
key, value = m.groups()
|
||||
sslProtoD[key] = value
|
||||
@@ -165,7 +165,7 @@ for fl in oSSLinclude:
|
||||
continue
|
||||
fp = open(fname, 'r')
|
||||
for line in fp.readlines():
|
||||
m = re.match('# *define\s+(\S+)\s+(\S+)', line)
|
||||
m = re.match(r'# *define\s+(\S+)\s+(\S+)', line)
|
||||
if m:
|
||||
value,key = m.groups()
|
||||
if key.startswith('0x') and "_CK_" in value:
|
||||
|
||||
Reference in New Issue
Block a user