Commit 02a2d475 authored by Jason R. Coombs's avatar Jason R. Coombs

Remove compatibility functions for platform information.

parent 5dfdad23
...@@ -27,6 +27,7 @@ import pkgutil ...@@ -27,6 +27,7 @@ import pkgutil
import token import token
import symbol import symbol
import operator import operator
import platform
from pkgutil import get_importer from pkgutil import get_importer
try: try:
...@@ -1106,23 +1107,6 @@ def to_filename(name): ...@@ -1106,23 +1107,6 @@ def to_filename(name):
""" """
return name.replace('-','_') return name.replace('-','_')
def _platinfo(attr):
try:
import platform
except ImportError:
return ''
return getattr(platform, attr, lambda:'')()
def _pyimp():
if sys.platform=='cli':
return 'IronPython'
elif sys.platform.startswith('java'):
return 'Jython'
elif '__pypy__' in sys.builtin_module_names:
return 'PyPy'
else:
return 'CPython'
class MarkerEvaluation(object): class MarkerEvaluation(object):
values = { values = {
...@@ -1130,9 +1114,9 @@ class MarkerEvaluation(object): ...@@ -1130,9 +1114,9 @@ class MarkerEvaluation(object):
'sys_platform': lambda: sys.platform, 'sys_platform': lambda: sys.platform,
'python_full_version': lambda: sys.version.split()[0], 'python_full_version': lambda: sys.version.split()[0],
'python_version': lambda:'%s.%s' % (sys.version_info[0], sys.version_info[1]), 'python_version': lambda:'%s.%s' % (sys.version_info[0], sys.version_info[1]),
'platform_version': lambda: _platinfo('version'), 'platform_version': platform.version,
'platform_machine': lambda: _platinfo('machine'), 'platform_machine': platform.machine,
'python_implementation': lambda: _platinfo('python_implementation') or _pyimp(), 'python_implementation': platform.python_implementation,
} }
@classmethod @classmethod
......
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