mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
This broke tests on the 'aarch64 Fedora Stable Clang Installed 3.x' and
'AMD64 Fedora Stable Clang Installed 3.x' build bots.
This reverts commit da4899b94a
.
This commit is contained in:
parent
5221d9ce0e
commit
5326c27fc6
7 changed files with 228 additions and 239 deletions
|
@ -558,8 +558,7 @@ class PurePath:
|
|||
# paths shouldn't match wildcards, so we change it to the empty string.
|
||||
path = str(self) if self.parts else ''
|
||||
pattern = str(pattern) if pattern.parts else ''
|
||||
globber = _StringGlobber(self.parser.sep, case_sensitive,
|
||||
recursive=True, include_hidden=True)
|
||||
globber = _StringGlobber(self.parser.sep, case_sensitive, recursive=True)
|
||||
return globber.compile(pattern)(path) is not None
|
||||
|
||||
def match(self, path_pattern, *, case_sensitive=None):
|
||||
|
@ -581,8 +580,7 @@ class PurePath:
|
|||
return False
|
||||
if len(path_parts) > len(pattern_parts) and path_pattern.anchor:
|
||||
return False
|
||||
globber = _StringGlobber(self.parser.sep, case_sensitive,
|
||||
include_hidden=True)
|
||||
globber = _StringGlobber(self.parser.sep, case_sensitive)
|
||||
for path_part, pattern_part in zip(path_parts, pattern_parts):
|
||||
match = globber.compile(pattern_part)
|
||||
if match(path_part) is None:
|
||||
|
@ -857,8 +855,7 @@ class Path(PurePath):
|
|||
case_pedantic = True
|
||||
parts = self._parse_pattern(pattern)
|
||||
recursive = True if recurse_symlinks else _no_recurse_symlinks
|
||||
globber = _StringGlobber(self.parser.sep, case_sensitive, case_pedantic,
|
||||
recursive, include_hidden=True)
|
||||
globber = _StringGlobber(self.parser.sep, case_sensitive, case_pedantic, recursive)
|
||||
select = globber.selector(parts[::-1])
|
||||
root = str(self)
|
||||
paths = select(self.parser.join(root, ''))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue