Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
A better if-condition in make_venv
  • Loading branch information
AlexWaygood committed Dec 27, 2022
commit c5c93c920b613aabec4435916f721ae35339c0e1
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def make_venv(venv_dir: Path) -> VenvInfo:
try:
venv.create(venv_dir, with_pip=True, clear=True)
except subprocess.CalledProcessError as e:
if "ensurepip" in e.cmd and "KeyboardInterrupt" not in e.stdout:
if "ensurepip" in e.cmd and b"KeyboardInterrupt" not in e.stdout.splitlines():

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "if you're on Linux, you might need to install the python3-venv package" message was showing up every time I interrupted the script with a KeyboardInterrupt during the "concurrently create many venvs" step, and it was kinda annoying.

print_error(
"stubtest requires a Python installation with ensurepip. "
"If on Linux, you may need to install the python3-venv package."
Expand Down