diff options
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 3e726a7856..e48ad0b6e7 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -13,7 +13,6 @@ # Python bug tracker (http://bugs.python.org) and assign them to "lemburg". # # Still needed: -# * more support for WinCE # * support for MS-DOS (PythonDX ?) # * support for Amiga and other still unsupported platforms running Python # * support for additional Linux distributions @@ -252,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 @@ -408,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: # @@ -509,7 +508,7 @@ def win32_ver(release='', version='', csd='', ptype=''): from _winreg import OpenKeyEx, QueryValueEx, CloseKey, HKEY_LOCAL_MACHINE winver = getwindowsversion() - maj, min, build = winver._platform_version or winver[:3] + maj, min, build = winver.platform_version or winver[:3] version = '{0}.{1}.{2}'.format(maj, min, build) release = (_WIN32_CLIENT_RELEASES.get((maj, min)) or @@ -1095,22 +1094,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 = {} @@ -1345,7 +1344,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, ) |