Commit adbb4edd authored by Jason R. Coombs's avatar Jason R. Coombs

Deprecate fix_jython_executable and replace with JythonCommandSpec

parent 9209b9f7
...@@ -1844,25 +1844,14 @@ def chmod(path, mode): ...@@ -1844,25 +1844,14 @@ def chmod(path, mode):
def fix_jython_executable(executable, options): def fix_jython_executable(executable, options):
if sys.platform.startswith('java') and is_sh(executable): warnings.warn("Use JythonCommandSpec", DeprecationWarning, stacklevel=2)
# Workaround for Jython is not needed on Linux systems.
import java
if java.lang.System.getProperty("os.name") == "Linux": if not JythonCommandSpec.relevant():
return executable return executable
# Workaround Jython's sys.executable being a .sh (an invalid cmd = CommandSpec.best().from_param(executable)
# shebang line interpreter) cmd.install_options(options)
if options: return cmd.as_header().lstrip('#!').rstrip('\n')
# Can't apply the workaround, leave it broken
log.warn(
"WARNING: Unable to adapt shebang line for Jython,"
" the following script is NOT executable\n"
" see http://bugs.jython.org/issue1112 for"
" more information.")
else:
return '/usr/bin/env %s' % executable
return executable
class CommandSpec(list): class CommandSpec(list):
......
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