1.1 --- a/python.core/src/org/netbeans/modules/python/api/PythonPlatformManager.java Mon Sep 26 18:47:08 2016 +0200
1.2 +++ b/python.core/src/org/netbeans/modules/python/api/PythonPlatformManager.java Tue Oct 11 18:11:45 2016 +0200
1.3 @@ -363,14 +363,29 @@
1.4 PythonPlatform platform = null;
1.5 try{
1.6 PythonExecution pye = new PythonExecution();
1.7 - int split = cmd.indexOf(" ");
1.8 - pye.setCommand(split > 0 ? cmd.substring(0, split) : cmd);
1.9 + String[] cmdParts = cmd.split(" ");
1.10 + String cmdWithoutArgs = "";
1.11 + String cmdArgs = "";
1.12 + boolean isCommandComplete = false;
1.13 + for (String cmdPart: cmdParts) {
1.14 + if (!isCommandComplete) {
1.15 + cmdWithoutArgs = cmdWithoutArgs + " " + cmdPart;
1.16 + } else {
1.17 + cmdArgs = cmdArgs + " " + cmdPart;
1.18 + }
1.19 +
1.20 + if (cmdPart.contains("python")) {
1.21 + isCommandComplete = true;
1.22 + }
1.23 + }
1.24 + cmdWithoutArgs = cmdWithoutArgs.trim();
1.25 + cmdArgs = cmdArgs.trim();
1.26 + pye.setCommand(cmdWithoutArgs);
1.27 pye.setDisplayName("Python Properties");
1.28 File info = InstalledFileLocator.getDefault().locate(
1.29 "platform_info.py", "org.netbeans.modules.python.core", false);
1.30 pye.setScript(info.getAbsolutePath());
1.31 - if(split > 0) {
1.32 - String cmdArgs = cmd.substring(split).trim();
1.33 + if(cmdArgs.length() > 0) {
1.34 pye.setCommandArgs(cmdArgs);
1.35 }
1.36 pye.setShowControls(false);