Skip to content

Commit

Permalink
Correctly recognize interpreters that has suffixes (#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal authored and gaborbernat committed Sep 3, 2019
1 parent f39983c commit 6cb400e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Morgan Fainberg
Nick Douma
Nick Prendergast
Oliver Bestwalter
Pablo Galindo
Paweł Adamczak
Philip Thiem
Pierre-Jean Campigotto
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/1415.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Recognize correctly interpreters that have suffixes (like python3.7-dbg).
2 changes: 1 addition & 1 deletion src/tox/interpreters/py_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def from_name(cls, base_python):
if os.path.isabs(base_python):
path = base_python
else:
match = re.match(r"(python|pypy|jython)(\d)?(?:\.(\d+))?(-(32|64))?", base_python)
match = re.match(r"(python|pypy|jython)(\d)?(?:\.(\d+))?(-(32|64))?$", base_python)
if match:
groups = match.groups()
name = groups[0]
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/interpreters/test_py_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
def test_py_3_10():
spec = PythonSpec.from_name("python3.10")
assert (spec.major, spec.minor) == (3, 10)


def test_debug_python():
spec = PythonSpec.from_name("python3.10-dbg")
assert (spec.major, spec.minor) == (None, None)

0 comments on commit 6cb400e

Please sign in to comment.