diff options
-rw-r--r-- | CHANGES.txt | 6 | ||||
-rw-r--r-- | _markerlib/markers.py | 11 | ||||
-rwxr-xr-x | setuptools/sandbox.py | 5 |
3 files changed, 20 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index db7609af..4a799497 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,12 @@ CHANGES ======= ------ +0.6.33 +------ + +* Fix 2 errors with Jython 2.5. + +------ 0.6.32 ------ diff --git a/_markerlib/markers.py b/_markerlib/markers.py index 23091e64..c93d7f3b 100644 --- a/_markerlib/markers.py +++ b/_markerlib/markers.py @@ -25,7 +25,16 @@ import weakref _builtin_compile = compile -from platform import python_implementation +try: + from platform import python_implementation +except ImportError: + if os.name == "java": + # Jython 2.5 has ast module, but not platform.python_implementation() function. + def python_implementation(): + return "Jython" + else: + raise + # restricted set of variables _VARS = {'sys.platform': sys.platform, diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py index 64f725e7..1583b81f 100755 --- a/setuptools/sandbox.py +++ b/setuptools/sandbox.py @@ -1,5 +1,8 @@ import os, sys, __builtin__, tempfile, operator, pkg_resources -_os = sys.modules[os.name] +if os.name == "java": + import org.python.modules.posix.PosixModule as _os +else: + _os = sys.modules[os.name] try: _file = file except NameError: |