Commits

Arfrever Frehtes Taifersar Arahesis committed 7101a0a

Fix 2 errors with Jython 2.5.
(Now there remain 1 failure and 2 errors with Jython 2.5 and 1 failure and 5 errors with Jython 2.7.)

  • Participants
  • Parent commits c0b5340

Comments (0)

Files changed (3)

 =======
 
 ------
+0.6.33
+------
+
+* Fix 2 errors with Jython 2.5.
+
+------
 0.6.32
 ------
 

File _markerlib/markers.py

 
 _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,

File setuptools/sandbox.py

 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: