Skip to content

Commit

Permalink
refactor: very minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Apr 6, 2022
1 parent 031dda5 commit 48f8269
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion nox/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __init__(self, reason: str | None = None) -> None:

def which(program: str, paths: list[str] | None) -> str:
"""Finds the full path to an executable."""
full_path = None

if paths is not None:
full_path = shutil.which(program, path=os.pathsep.join(paths))
Expand Down
4 changes: 1 addition & 3 deletions nox/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ def locate_using_path_and_version(version: str) -> str | None:
if path_python:
prefix = f"{version}."
ret = subprocess.run([path_python, "-c", script], check=False, text=True)
if ret.returncode != 0 or not ret.stdout:
return None
if ret.stdout.startswith(prefix):
if ret.returncode == 0 and ret.stdout and ret.stdout.startswith(prefix):
return str(path_python)

return None
Expand Down

0 comments on commit 48f8269

Please sign in to comment.