Skip to content

Commit 123d9b6

Browse files
Kartik Rajwesm
Kartik Raj
authored andcommitted
Ensures python 2.x are discovered even when running interpreterInfo.py script prints more than just the script output (microsoft/vscode-python#18284)
1 parent dff6e64 commit 123d9b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

extensions/positron-python/pythonFiles/get_output_via_markers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Sometimes executing scripts can print out stuff before the actual output is
88
# printed. For eg. when activating conda. Hence, printing out markers to make
99
# it more resilient to pull the output.
10-
print(">>>PYTHON-EXEC-OUTPUT", end="")
10+
print(">>>PYTHON-EXEC-OUTPUT")
1111

1212
module = sys.argv[1]
1313
if module == "-c":
@@ -21,4 +21,4 @@
2121
else:
2222
runpy.run_module(module, run_name="__main__", alter_sys=True)
2323

24-
print("<<<PYTHON-EXEC-OUTPUT", end="")
24+
print("<<<PYTHON-EXEC-OUTPUT")

extensions/positron-python/src/client/common/process/rawProcessApis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function filterOutputUsingCondaRunMarkers(stdout: string) {
164164
// run, see `get_output_via_markers.py`.
165165
const regex = />>>PYTHON-EXEC-OUTPUT([\s\S]*)<<<PYTHON-EXEC-OUTPUT/;
166166
const match = stdout.match(regex);
167-
const filteredOut = match !== null && match.length >= 2 ? match[1] : '';
167+
const filteredOut = match !== null && match.length >= 2 ? match[1].trim() : '';
168168
return filteredOut.length ? filteredOut : stdout;
169169
}
170170

0 commit comments

Comments
 (0)