Skip to content

Commit b13087a

Browse files
author
Kartik Raj
authored
Ensures python 2.x are discovered even when running interpreterInfo.py script prints more than just the script output (microsoft#18284)
1 parent ae2fc0b commit b13087a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎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")

‎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)