Commit 6176fc44 authored by pombredanne's avatar pombredanne

Use more explicit variable names

parent c6772294
...@@ -1437,35 +1437,38 @@ def _default_globals(): ...@@ -1437,35 +1437,38 @@ def _default_globals():
globals_defs = {'sys': sys, 'os': os, 'platform': platform, 're': re,} globals_defs = {'sys': sys, 'os': os, 'platform': platform, 're': re,}
# major python versions as python2 and python3 # major python major_python_versions as python2 and python3
vertu = platform.python_version_tuple() major_python_versions = platform.python_version_tuple()
globals_defs.update({'python2': vertu[0] == '2', 'python3': vertu[0] == '3'}) globals_defs.update({'python2': major_python_versions[0] == '2',
'python3': major_python_versions[0] == '3'})
# minor python versions as python24, python25 ... python36 # minor python major_python_versions as python24, python25 ... python36
pyver = ('24', '25', '26', '27', '30', '31', '32', '33', '34', '35', '36') minor_python_versions = ('24', '25', '26', '27',
for v in pyver: '30', '31', '32', '33', '34', '35', '36')
globals_defs['python' + v] = ''.join(vertu[:2]) == v for v in minor_python_versions:
globals_defs['python' + v] = ''.join(major_python_versions[:2]) == v
# interpreter type # interpreter type
sysver = sys.version.lower() sys_version = sys.version.lower()
pypy = 'pypy' in sysver pypy = 'pypy' in sys_version
jython = 'java' in sysver jython = 'java' in sys_version
ironpython ='iron' in sysver ironpython ='iron' in sys_version
# assume CPython, if nothing else. # assume CPython, if nothing else.
cpython = not any((pypy, jython, ironpython,)) cpython = not any((pypy, jython, ironpython,))
globals_defs.update({'cpython': cpython, globals_defs.update({'cpython': cpython,
'pypy': pypy, 'pypy': pypy,
'jython': jython, 'jython': jython,
'ironpython': ironpython}) 'ironpython': ironpython})
# operating system # operating system
sysplat = str(sys.platform).lower() sys_platform = str(sys.platform).lower()
globals_defs.update({'linux': 'linux' in sysplat, globals_defs.update({'linux': 'linux' in sys_platform,
'windows': 'win32' in sysplat, 'windows': 'win32' in sys_platform,
'cygwin': 'cygwin' in sysplat, 'cygwin': 'cygwin' in sys_platform,
'solaris': 'sunos' in sysplat, 'solaris': 'sunos' in sys_platform,
'macosx': 'darwin' in sysplat, 'macosx': 'darwin' in sys_platform,
'posix': 'posix' in os.name.lower()}) 'posix': 'posix' in os.name.lower()})
#bits and endianness #bits and endianness
import struct import struct
void_ptr_size = struct.calcsize('P') * 8 void_ptr_size = struct.calcsize('P') * 8
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment