mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-28 01:07:08 -05:00
Suppress syntax warnings on Python 3.12.
Python 3.12 has a new warning for backslash-character pairs that are not valid escape sequences at the level of string literals, as opposed to in some interior syntax such as regular expressions (https://docs.python.org/3/whatsnew/3.12.html#other-language-changes). Suppress it by using raw strings.
This commit is contained in:
parent
400c895ced
commit
22f8122b13
@ -27,7 +27,7 @@ def winmungestr(s):
|
||||
candot = 0
|
||||
r = ""
|
||||
for c in s:
|
||||
if c in ' \*?%~' or ord(c)<ord(' ') or (c == '.' and not candot):
|
||||
if c in r' \*?%~' or ord(c)<ord(' ') or (c == '.' and not candot):
|
||||
r = r + ("%%%02X" % ord(c))
|
||||
else:
|
||||
r = r + c
|
||||
@ -385,7 +385,7 @@ class OutputFormatter(object):
|
||||
class WindowsOutputFormatter(OutputFormatter):
|
||||
def header(self):
|
||||
# Output REG file header.
|
||||
self.fh.write("""REGEDIT4
|
||||
self.fh.write(r"""REGEDIT4
|
||||
|
||||
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys]
|
||||
""")
|
||||
|
@ -308,8 +308,8 @@ def _lex_testcrypt_header(header):
|
||||
# And then match a token
|
||||
'({})'.format('|'.join((
|
||||
# Punctuation
|
||||
'\(',
|
||||
'\)',
|
||||
r'\(',
|
||||
r'\)',
|
||||
',',
|
||||
# Identifier
|
||||
'[A-Za-z_][A-Za-z0-9_]*',
|
||||
|
Loading…
x
Reference in New Issue
Block a user