Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-104484: Add parameter @case_sensitive to pathlib.PurePath.match() function #104565

Merged
merged 11 commits into from
May 18, 2023
Prev Previous commit
Update pathlib.py
  • Loading branch information
thirumurugan-git authored and thirumurugan.ka committed May 18, 2023
commit afee333983b292f3a4235af3f8ceaa21064c682a
3 changes: 1 addition & 2 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ def __init__(self, pat, child_parts, flavour, case_sensitive):
if case_sensitive is None:
# TODO: evaluate case-sensitivity of each directory in _select_from()
case_sensitive = _is_case_sensitive(flavour)
flags = re.NOFLAG if case_sensitive else re.IGNORECASE
self.match = re.compile(fnmatch.translate(pat), flags=flags).fullmatch
self.match = _compile_pattern(pat, case_sensitive)

def _select_from(self, parent_path, scandir):
try:
Expand Down