mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
#27364: fix "incorrect" uses of escape character in the stdlib.
And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
This commit is contained in:
parent
513d7478a1
commit
44b548dda8
83 changed files with 324 additions and 324 deletions
|
@ -221,7 +221,7 @@ class Command:
|
|||
self._ensure_stringlike(option, "string", default)
|
||||
|
||||
def ensure_string_list(self, option):
|
||||
"""Ensure that 'option' is a list of strings. If 'option' is
|
||||
r"""Ensure that 'option' is a list of strings. If 'option' is
|
||||
currently a string, we split it either on /,\s*/ or /\s+/, so
|
||||
"foo bar baz", "foo,bar,baz", and "foo, bar baz" all become
|
||||
["foo", "bar", "baz"].
|
||||
|
|
|
@ -623,7 +623,7 @@ class bdist_msi(Command):
|
|||
cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title,
|
||||
"OK", "OK", "OK", bitmap=False)
|
||||
cost.text("Title", 15, 6, 200, 15, 0x30003,
|
||||
"{\DlgFontBold8}Disk Space Requirements")
|
||||
r"{\DlgFontBold8}Disk Space Requirements")
|
||||
cost.text("Description", 20, 20, 280, 20, 0x30003,
|
||||
"The disk space required for the installation of the selected features.")
|
||||
cost.text("Text", 20, 53, 330, 60, 3,
|
||||
|
@ -670,7 +670,7 @@ class bdist_msi(Command):
|
|||
progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title,
|
||||
"Cancel", "Cancel", "Cancel", bitmap=False)
|
||||
progress.text("Title", 20, 15, 200, 15, 0x30003,
|
||||
"{\DlgFontBold8}[Progress1] [ProductName]")
|
||||
r"{\DlgFontBold8}[Progress1] [ProductName]")
|
||||
progress.text("Text", 35, 65, 300, 30, 3,
|
||||
"Please wait while the Installer [Progress2] [ProductName]. "
|
||||
"This may take several minutes.")
|
||||
|
|
|
@ -51,7 +51,7 @@ class build_scripts(Command):
|
|||
|
||||
|
||||
def copy_scripts(self):
|
||||
"""Copy each script listed in 'self.scripts'; if it's marked as a
|
||||
r"""Copy each script listed in 'self.scripts'; if it's marked as a
|
||||
Python script in the Unix way (first line matches 'first_line_re',
|
||||
ie. starts with "\#!" and contains "python"), then adjust the first
|
||||
line to refer to the current Python interpreter as we copy.
|
||||
|
|
|
@ -368,7 +368,7 @@ def check_config_h():
|
|||
return (CONFIG_H_UNCERTAIN,
|
||||
"couldn't read '%s': %s" % (fn, exc.strerror))
|
||||
|
||||
RE_VERSION = re.compile(b'(\d+\.\d+(\.\d+)*)')
|
||||
RE_VERSION = re.compile(br'(\d+\.\d+(\.\d+)*)')
|
||||
|
||||
def _find_exe_version(cmd):
|
||||
"""Find the version of an executable by running `cmd` in the shell.
|
||||
|
|
|
@ -716,7 +716,7 @@ class MSVCCompiler(CCompiler) :
|
|||
r"""VC\d{2}\.CRT("|').*?(/>|</assemblyIdentity>)""",
|
||||
re.DOTALL)
|
||||
manifest_buf = re.sub(pattern, "", manifest_buf)
|
||||
pattern = "<dependentAssembly>\s*</dependentAssembly>"
|
||||
pattern = r"<dependentAssembly>\s*</dependentAssembly>"
|
||||
manifest_buf = re.sub(pattern, "", manifest_buf)
|
||||
# Now see if any other assemblies are referenced - if not, we
|
||||
# don't want a manifest embedded.
|
||||
|
|
|
@ -278,7 +278,7 @@ def parse_config_h(fp, g=None):
|
|||
|
||||
# Regexes needed for parsing Makefile (and similar syntaxes,
|
||||
# like old-style Setup files).
|
||||
_variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
|
||||
_variable_rx = re.compile(r"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
|
||||
_findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)")
|
||||
_findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}")
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ def split_provision(value):
|
|||
global _provision_rx
|
||||
if _provision_rx is None:
|
||||
_provision_rx = re.compile(
|
||||
"([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$",
|
||||
r"([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$",
|
||||
re.ASCII)
|
||||
value = value.strip()
|
||||
m = _provision_rx.match(value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue