mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-98884: [pathlib] remove hasattr
check for lru_cache
(#98885)
This commit is contained in:
parent
e99c507013
commit
e3b9832e57
1 changed files with 1 additions and 3 deletions
|
@ -200,6 +200,7 @@ _posix_flavour = _PosixFlavour()
|
|||
# Globbing helpers
|
||||
#
|
||||
|
||||
@functools.lru_cache()
|
||||
def _make_selector(pattern_parts, flavour):
|
||||
pat = pattern_parts[0]
|
||||
child_parts = pattern_parts[1:]
|
||||
|
@ -215,9 +216,6 @@ def _make_selector(pattern_parts, flavour):
|
|||
cls = _PreciseSelector
|
||||
return cls(pat, child_parts, flavour)
|
||||
|
||||
if hasattr(functools, "lru_cache"):
|
||||
_make_selector = functools.lru_cache()(_make_selector)
|
||||
|
||||
|
||||
class _Selector:
|
||||
"""A selector matches a specific glob pattern part against the children
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue