Arfrever Frehtes Taifersar Arahesis avatar Arfrever Frehtes Taifersar Arahesis committed 12849ea

Disable workaround for Jython scripts on Linux systems.

Comments (0)

Files changed (3)

 
 * Fix 2 errors with Jython 2.5.
 * Fix 1 failure with Jython 2.5 and 2.7.
+* Disable workaround for Jython scripts on Linux systems.
 
 ------
 0.6.32

setuptools/command/easy_install.py

 
 def fix_jython_executable(executable, options):
     if sys.platform.startswith('java') and is_sh(executable):
+        # Workaround for Jython is not needed on Linux systems.
+        import java
+        if java.lang.System.getProperty("os.name") == "Linux":
+            return executable
+
         # Workaround Jython's sys.executable being a .sh (an invalid
         # shebang line interpreter)
         if options:

setuptools/tests/test_resources.py

         if (sys.version_info >= (3,) and os.environ.get("LC_CTYPE")
             in (None, "C", "POSIX")):
             return
+
+        class java:
+            class lang:
+                class System:
+                    @staticmethod
+                    def getProperty(property):
+                        return ""
+        sys.modules["java"] = java
+
         platform = sys.platform
         sys.platform = 'java1.5.0_13'
         stdout = sys.stdout
                              '#!%s -x\n' % self.non_ascii_exe)
             self.assertTrue('Unable to adapt shebang line' in sys.stdout.getvalue())
         finally:
+            del sys.modules["java"]
             sys.platform = platform
             sys.stdout = stdout
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.