python-venv: use correct python name for which call (#44048)

This commit is contained in:
John W. Parent 2024-05-07 03:32:44 -04:00 committed by GitHub
parent 0a353abc42
commit b35ec605fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,8 @@ def bindir(self):
@property @property
def command(self): def command(self):
"""Returns a python Executable instance""" """Returns a python Executable instance"""
return which("python3", path=self.bindir) python_name = "python" if self.spec.satisfies("platform=windows") else "python3"
return which(python_name, path=self.bindir)
def _get_path(self, name) -> str: def _get_path(self, name) -> str:
return self.command( return self.command(