Skip to content

Commit

Permalink
py_info.py: Discover python interpreter in a case insensitive manner
Browse files Browse the repository at this point in the history
Closes pypa#1624
  • Loading branch information
PrajwalM2212 committed Feb 14, 2020
1 parent 811311c commit 594accf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/changelog/1624.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Discover python interpreter in a case insensitive manner - by :user:`PrajwalM2212`
2 changes: 1 addition & 1 deletion src/virtualenv/discovery/py_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def satisfies(self, spec, impl_must_match):
return False

if impl_must_match:
if spec.implementation is not None and spec.implementation != self.implementation:
if spec.implementation is not None and spec.implementation.lower() != self.implementation.lower():
return False

if spec.architecture is not None and spec.architecture != self.architecture:
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/discovery/py_info/test_py_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ def test_bad_exe_py_info_no_raise(tmp_path, caplog, capsys):
list(
"{}{}{}".format(impl, ".".join(str(i) for i in ver), arch)
for impl, ver, arch in itertools.product(
([CURRENT.implementation] + (["python"] if CURRENT.implementation == "CPython" else [])),
(
[CURRENT.implementation]
+ (["python"] if CURRENT.implementation == "CPython" else [])
+ (["cpython"] if CURRENT.implementation == "CPython" else [])
),
[sys.version_info[0 : i + 1] for i in range(3)],
["", "-{}".format(CURRENT.architecture)],
)
Expand Down

0 comments on commit 594accf

Please sign in to comment.