Lines Matching +full:pypy +full:- +full:c
3 """ This module tries to retrieve as much platform-identifying data as
11 # This module is maintained by Marc-Andre Lemburg <mal@egenix.com>.
16 # * support for MS-DOS (PythonDX ?)
20 # Many thanks to all those who helped adding platform-specific
35 # 1.0.8 - changed Windows support to read version from kernel32.dll
36 # 1.0.7 - added DEV_NULL
37 # 1.0.6 - added linux_distribution()
38 # 1.0.5 - fixed Java support to allow running the module on Jython
39 # 1.0.4 - added IronPython support
40 # 1.0.3 - added normalization of Windows system name
41 # 1.0.2 - added more Windows support
42 # 1.0.1 - reformatted to make doc.py happy
43 # 1.0.0 - reformatted a bit and checked into Python CVS
44 # 0.8.0 - added sys.version parser and various new access
46 # 0.7.2 - fixed architecture() to use sizeof(pointer) where available
47 # 0.7.1 - added support for Caldera OpenLinux
48 # 0.7.0 - some fixes for WinCE; untabified the source file
49 # 0.6.2 - support for OpenVMS - requires version 1.5.2-V006 or higher and
51 # 0.6.1 - added code to prevent 'uname -p' on platforms which are
53 # 0.6.0 - fixed win32_ver() to hopefully work on Win95,98,NT and Win2k;
54 # did some cleanup of the interfaces - some APIs have changed
55 # 0.5.5 - fixed another type in the MacOS code... should have
56 # used more coffee today ;-)
57 # 0.5.4 - fixed a few typos in the MacOS code
58 # 0.5.3 - added experimental MacOS support; added better popen()
59 # workarounds in _syscmd_ver() -- still not 100% elegant
61 # 0.5.2 - fixed uname() to return '' instead of 'unknown' in all
64 # 0.5.1 - included code for slackware dist; added exception handlers
68 # 0.5.0 - changed the API names referring to system commands to *syscmd*;
70 # API (was system_ver() in previous versions) -- use uname()
73 # 0.4.0 - added win32_ver() and modified the platform() output for WinXX
74 # 0.3.4 - fixed a bug in _follow_symlinks()
75 # 0.3.3 - fixed popen() and "file" command invokation bugs
76 # 0.3.2 - added architecture() API and support for it in platform()
77 # 0.3.1 - fixed syscmd_ver() RE to support Windows NT
78 # 0.3.0 - added system alias support
79 # 0.2.3 - removed 'wince' again... oh well.
80 # 0.2.2 - added 'wince' to syscmd_ver() supported platforms
81 # 0.2.1 - added cache logic and changed the platform string format
82 # 0.2.0 - changed the API to use functions instead of module globals
84 # 0.1.0 - first release
93 Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
94 Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com
141 # http://php.net/manual/en/function.version-compare.php
148 'c': 40,
154 _component_re = re.compile(r'([0-9]+|[._+-])')
159 if v not in '._+-':
172 b'(GLIBC_([0-9.]+))'
174 br'(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)', re.ASCII)
208 binary = binary[max(pos, len(binary) - 1000):] + chunk
229 if threads and version[-len(threads):] != threads:
243 if os.path.exists('/var/adm/inst-log/info'):
246 with open('/var/adm/inst-log/info') as f:
256 values = value.split('-')
264 pkg = line.split('-')
273 for n in range(len(verfiles)-1, -1, -1):
274 if verfiles[n][:14] != 'slack-version-':
279 version = verfiles[-1][14:]
284 _release_filename = re.compile(r'(\w+)[-_](release|version)', re.ASCII)
289 _release_version = re.compile(r'([^0-9]+)'
295 # and http://linuxmafia.com/faq/Admin/release-files.html
296 # and http://data.linux-ntfs.org/rpm/whichrpm
318 # Pre-LSB format: "distro x.x (codename)"
381 encoding='utf-8', errors='surrogateescape') as f:
416 def popen(cmd, mode='r', bufsize=-1):
473 for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
495 if release[-1] == '.':
496 release = release[:-1]
497 if version[-1] == '.':
498 version = version[:-1]
507 # Strictly, 5.2 client is XP 64-bit, but platform.py historically
687 # Modify release (marketing release = SunOS release - 3)
695 major = major - 3
705 # IRIX reports IRIX64 on platforms with 64-bit support; yet it
706 # is really a version and not a different platform, since 32-bit
725 compatible format e.g. "system-version-machine".
728 platform = '-'.join(x.strip() for x in filter(len, args))
732 platform = platform.replace('/', '-')
733 platform = platform.replace('\\', '-')
734 platform = platform.replace(':', '-')
735 platform = platform.replace(';', '-')
736 platform = platform.replace('"', '-')
737 platform = platform.replace('(', '-')
738 platform = platform.replace(')', '-')
743 # Fold '--'s and remove trailing '-'
745 cleaned = platform.replace('--', '-')
749 while platform[-1] == '-':
750 platform = platform[:-1]
802 The function uses the -b option of the file command to have it
817 output = proc.communicate()[0].decode('latin-1')
826 # Default values for architecture; non-empty strings override the
850 platforms. On some non-Unix platforms where the "file" command
889 if '32-bit' in fileout:
894 elif '64-bit' in fileout:
908 elif 'MS-DOS' in fileout:
1034 processor = _syscmd_uname('-p', '')
1139 r'\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)'
1145 r'\[PyPy [^\]]+\]?')
1209 elif "PyPy" in sys_version:
1210 # PyPy
1211 name = "PyPy"
1214 raise ValueError("failed to parse PyPy sys.version: %s" %
1258 'CPython' (C implementation of Python),
1261 'PyPy' (Python implementation of Python).
1330 ### The Opus Magnum of platform strings :-)
1427 terse = ('terse' in sys.argv or '--terse' in sys.argv)
1428 aliased = (not 'nonaliased' in sys.argv and not '--nonaliased' in sys.argv)