Skip to content

Ensures python 2.x are discovered even when running interpreterInfo.py script prints more than just the script output #18284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pythonFiles/get_output_via_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Sometimes executing scripts can print out stuff before the actual output is
# printed. For eg. when activating conda. Hence, printing out markers to make
# it more resilient to pull the output.
print(">>>PYTHON-EXEC-OUTPUT", end="")
print(">>>PYTHON-EXEC-OUTPUT")

module = sys.argv[1]
if module == "-c":
Expand All @@ -21,4 +21,4 @@
else:
runpy.run_module(module, run_name="__main__", alter_sys=True)

print("<<<PYTHON-EXEC-OUTPUT", end="")
print("<<<PYTHON-EXEC-OUTPUT")
2 changes: 1 addition & 1 deletion src/client/common/process/rawProcessApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function filterOutputUsingCondaRunMarkers(stdout: string) {
// run, see `get_output_via_markers.py`.
const regex = />>>PYTHON-EXEC-OUTPUT([\s\S]*)<<<PYTHON-EXEC-OUTPUT/;
const match = stdout.match(regex);
const filteredOut = match !== null && match.length >= 2 ? match[1] : '';
const filteredOut = match !== null && match.length >= 2 ? match[1].trim() : '';
return filteredOut.length ? filteredOut : stdout;
}

Expand Down