summaryrefslogtreecommitdiff
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-09-08 13:59:53 -0400
committerR David Murray <rdmurray@bitdance.com>2016-09-08 13:59:53 -0400
commit44b548dda872c0d4f30afd6b44fd74b053a55ad8 (patch)
treeb3c1ff8485bc279000f9db95491ebc69a4385876 /Lib/platform.py
parent513d7478a136e7646075592da2593476299cc8be (diff)
downloadcpython-git-44b548dda872c0d4f30afd6b44fd74b053a55ad8.tar.gz
#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.
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-xLib/platform.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index a5dd763907..9f7b59f9e6 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -251,13 +251,13 @@ def _dist_try_harder(distname, version, id):
_release_filename = re.compile(r'(\w+)[-_](release|version)', re.ASCII)
_lsb_release_version = re.compile(r'(.+)'
- ' release '
- '([\d.]+)'
- '[^(]*(?:\((.+)\))?', re.ASCII)
+ r' release '
+ r'([\d.]+)'
+ r'[^(]*(?:\((.+)\))?', re.ASCII)
_release_version = re.compile(r'([^0-9]+)'
- '(?: release )?'
- '([\d.]+)'
- '[^(]*(?:\((.+)\))?', re.ASCII)
+ r'(?: release )?'
+ r'([\d.]+)'
+ r'[^(]*(?:\((.+)\))?', re.ASCII)
# See also http://www.novell.com/coolsolutions/feature/11251.html
# and http://linuxmafia.com/faq/Admin/release-files.html
@@ -407,8 +407,8 @@ def _norm_version(version, build=''):
return version
_ver_output = re.compile(r'(?:([\w ]+) ([\w.]+) '
- '.*'
- '\[.* ([\d.]+)\])')
+ r'.*'
+ r'\[.* ([\d.]+)\])')
# Examples of VER command output:
#
@@ -1153,22 +1153,22 @@ _sys_version_parser = re.compile(
_ironpython_sys_version_parser = re.compile(
r'IronPython\s*'
- '([\d\.]+)'
- '(?: \(([\d\.]+)\))?'
- ' on (.NET [\d\.]+)', re.ASCII)
+ r'([\d\.]+)'
+ r'(?: \(([\d\.]+)\))?'
+ r' on (.NET [\d\.]+)', re.ASCII)
# IronPython covering 2.6 and 2.7
_ironpython26_sys_version_parser = re.compile(
r'([\d.]+)\s*'
- '\(IronPython\s*'
- '[\d.]+\s*'
- '\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)'
+ r'\(IronPython\s*'
+ r'[\d.]+\s*'
+ r'\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)'
)
_pypy_sys_version_parser = re.compile(
r'([\w.+]+)\s*'
- '\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*'
- '\[PyPy [^\]]+\]?')
+ r'\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*'
+ r'\[PyPy [^\]]+\]?')
_sys_version_cache = {}
@@ -1403,7 +1403,7 @@ def platform(aliased=0, terse=0):
# see issue #1322 for more information
warnings.filterwarnings(
'ignore',
- 'dist\(\) and linux_distribution\(\) '
+ r'dist\(\) and linux_distribution\(\) '
'functions are deprecated .*',
PendingDeprecationWarning,
)