Skip to content

Commit

Permalink
use text=True on subprocess calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Jun 4, 2023
1 parent 071fc66 commit f7e8ae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/poetry/core/masonry/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,14 @@ def _get_sys_tags(self) -> list[str]:
""",
],
stderr=subprocess.STDOUT,
text=True,
)
except subprocess.CalledProcessError as e:
raise RuntimeError(
"Failed to get sys_tags for python interpreter"
f" '{self.executable.as_posix()}':\n{decode(e.output)}"
)
return decode(output).strip().splitlines()
return output.strip().splitlines()

@property
def tag(self) -> str:
Expand Down
12 changes: 5 additions & 7 deletions src/poetry/core/vcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ def get_vcs(directory: Path) -> Git | None:
try:
from poetry.core.vcs.git import executable

git_dir = (
subprocess.check_output(
[executable(), "rev-parse", "--show-toplevel"], stderr=subprocess.STDOUT
)
.decode()
.strip()
)
git_dir = subprocess.check_output(
[executable(), "rev-parse", "--show-toplevel"],
stderr=subprocess.STDOUT,
text=True,
).strip()

vcs = Git(Path(git_dir))

Expand Down

0 comments on commit f7e8ae9

Please sign in to comment.