Skip to content

Commit

Permalink
Replace strings by constant
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jan 10, 2022
1 parent f1c0d2a commit 17c2b04
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions src/poetry/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,7 @@ def activate(self, python: str, io: "IO") -> "Env":
try:
python_version = decode(
subprocess.check_output(
list_to_shell_command(
[
python,
"-c",
"\"import sys; print('.'.join([str(s) for s in"
' sys.version_info[:3]]))"',
]
),
list_to_shell_command([python, "-c", GET_PYTHON_VERSION]),
shell=True,
)
)
Expand Down Expand Up @@ -730,14 +723,7 @@ def remove(self, python: str) -> "Env":
try:
python_version = decode(
subprocess.check_output(
list_to_shell_command(
[
python,
"-c",
"\"import sys; print('.'.join([str(s) for s in"
' sys.version_info[:3]]))"',
]
),
list_to_shell_command([python, "-c", GET_PYTHON_VERSION]),
shell=True,
)
)
Expand Down Expand Up @@ -806,14 +792,7 @@ def create_venv(
if executable:
python_patch = decode(
subprocess.check_output(
list_to_shell_command(
[
executable,
"-c",
"\"import sys; print('.'.join([str(s) for s in"
' sys.version_info[:3]]))"',
]
),
list_to_shell_command([executable, "-c", GET_PYTHON_VERSION]),
shell=True,
).strip()
)
Expand Down Expand Up @@ -861,14 +840,7 @@ def create_venv(
try:
python_patch = decode(
subprocess.check_output(
list_to_shell_command(
[
python,
"-c",
"\"import sys; print('.'.join([str(s) for s in"
' sys.version_info[:3]]))"',
]
),
list_to_shell_command([python, "-c", GET_PYTHON_VERSION]),
stderr=subprocess.STDOUT,
shell=True,
).strip()
Expand Down

0 comments on commit 17c2b04

Please sign in to comment.