mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-30 18:22:50 -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
|
candot = 0
|
||||||
r = ""
|
r = ""
|
||||||
for c in s:
|
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))
|
r = r + ("%%%02X" % ord(c))
|
||||||
else:
|
else:
|
||||||
r = r + c
|
r = r + c
|
||||||
@ -385,7 +385,7 @@ class OutputFormatter(object):
|
|||||||
class WindowsOutputFormatter(OutputFormatter):
|
class WindowsOutputFormatter(OutputFormatter):
|
||||||
def header(self):
|
def header(self):
|
||||||
# Output REG file header.
|
# Output REG file header.
|
||||||
self.fh.write("""REGEDIT4
|
self.fh.write(r"""REGEDIT4
|
||||||
|
|
||||||
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys]
|
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys]
|
||||||
""")
|
""")
|
||||||
|
@ -308,8 +308,8 @@ def _lex_testcrypt_header(header):
|
|||||||
# And then match a token
|
# And then match a token
|
||||||
'({})'.format('|'.join((
|
'({})'.format('|'.join((
|
||||||
# Punctuation
|
# Punctuation
|
||||||
'\(',
|
r'\(',
|
||||||
'\)',
|
r'\)',
|
||||||
',',
|
',',
|
||||||
# Identifier
|
# Identifier
|
||||||
'[A-Za-z_][A-Za-z0-9_]*',
|
'[A-Za-z_][A-Za-z0-9_]*',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user