Skip to content
Prev Previous commit
Update pathlib.py
  • Loading branch information
thirumurugan-git authored and thirumurugan-ka-15679 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