Skip to content

Commit

Permalink
only match case-insensitively if the fs is
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Apr 23, 2024
1 parent d9b52ad commit 468aa79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/virtualenv/discovery/py_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import os
import re

from virtualenv.info import fs_is_case_sensitive

PATTERN = re.compile(r"^(?P<impl>[a-zA-Z]+)?(?P<version>[0-9.]+)?(?:-(?P<arch>32|64))?$")


Expand Down Expand Up @@ -82,7 +84,7 @@ def generate_re(self, *, windows: bool) -> re.Pattern:
# Try matching `direct` first, so the `direct` group is filled when possible.
return re.compile(
rf"(?P<impl>{impl})(?P<v>{version}){suffix}$",
flags=re.IGNORECASE,
flags=re.IGNORECASE if fs_is_case_sensitive() else 0,
)

@property
Expand Down

0 comments on commit 468aa79

Please sign in to comment.