Skip to content
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
8 changes: 4 additions & 4 deletions src/poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def get_python_version(
if executable:
python_patch = decode(
subprocess.check_output(
[executable, "-c", GET_PYTHON_VERSION_ONELINER],
[str(executable), "-c", GET_PYTHON_VERSION_ONELINER],
).strip()
)

Expand Down Expand Up @@ -579,7 +579,7 @@ def activate(self, python: str) -> Env:
try:
python_version_string = decode(
subprocess.check_output(
[python_path, "-c", GET_PYTHON_VERSION_ONELINER],
[str(python_path), "-c", GET_PYTHON_VERSION_ONELINER],
)
)
except CalledProcessError as e:
Expand Down Expand Up @@ -906,7 +906,7 @@ def create_venv(
if executable:
python_patch = decode(
subprocess.check_output(
[executable, "-c", GET_PYTHON_VERSION_ONELINER],
[str(executable), "-c", GET_PYTHON_VERSION_ONELINER],
).strip()
)
python_minor = ".".join(python_patch.split(".")[:2])
Expand Down Expand Up @@ -954,7 +954,7 @@ def create_venv(
try:
python_patch = decode(
subprocess.check_output(
[python, "-c", GET_PYTHON_VERSION_ONELINER],
[str(python), "-c", GET_PYTHON_VERSION_ONELINER],
stderr=subprocess.STDOUT,
).strip()
)
Expand Down
1 change: 1 addition & 0 deletions tests/utils/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def check_output_wrapper(
) -> Callable[[list[str], Any, Any], str]:
def check_output(cmd: list[str], *args: Any, **kwargs: Any) -> str:
# cmd is a list, like ["python", "-c", "do stuff"]
assert all(isinstance(arg, str) for arg in cmd)
python_cmd = cmd[2]
if "sys.version_info[:3]" in python_cmd:
return version.text
Expand Down