Skip to content

Commit c30014e

Browse files
committed
Python 2.7 print CLI output to stderr instead of stdout causing the version to not be retrieved
1 parent 540eda0 commit c30014e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@
749749
<properties>
750750
<dev.name>albilu</dev.name>
751751
<netbeans.release.version>RELEASE170</netbeans.release.version>
752-
<next.version>0.3</next.version>
752+
<next.version>0.4</next.version>
753753
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
754754
</properties>
755755
</project>

src/main/java/org/netbeans/modules/python/PythonUtility.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,12 @@ public static Properties getProperties(@NonNull Project project) throws IOExcept
274274
}
275275

276276
public static String getVersion(String projectPythonExe) throws IOException {
277-
return getCommandOutput(new String[]{projectPythonExe, "--version"}, null);
277+
String commandOutput = getCommandOutput(new String[]{projectPythonExe, "--version"}, null);
278+
//Python 2.7 print CLI output to stderr instead of stdout causing the version to not be retrieved
279+
if (commandOutput.isEmpty() && projectPythonExe.contains("2.7")) {
280+
commandOutput = "Python 2.7";
281+
}
282+
return commandOutput;
278283
}
279284

280285
public static ImageIcon getErrorIcon() {

0 commit comments

Comments
 (0)