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
5 changes: 3 additions & 2 deletions nox/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,11 @@ def _resolved_interpreter(self) -> str:

# If this is just a X, X.Y, or X.Y.Z string, extract just the X / X.Y
# part and add Python to the front of it.
match = re.match(r"^(?P<xy_ver>\d(\.\d+)?)(\.\d+)?$", self.interpreter)
match = re.match(r"^(?P<xy_ver>\d(\.\d+)?)(\.\d+)?(?P<t>t?)$", self.interpreter)
if match:
xy_version = match.group("xy_ver")
cleaned_interpreter = f"python{xy_version}"
t = match.group("t")
cleaned_interpreter = f"python{xy_version}{t}"

# If the cleaned interpreter is on the PATH, go ahead and return it.
if shutil.which(cleaned_interpreter):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,8 @@ def test__resolved_interpreter_none(
("3.6.2", "python3.6"),
("3.10", "python3.10"),
("2.7.15", "python2.7"),
("3.13t", "python3.13t"),
("3.14.1t", "python3.14t"),
],
)
@mock.patch("nox.virtualenv._PLATFORM", new="linux")
Expand Down
Loading