gh-98884: [pathlib] remove hasattr check for lru_cache (#98885)

This commit is contained in:
Nikita Sobolev 2022-11-03 20:14:12 +03:00 committed by GitHub
parent e99c507013
commit e3b9832e57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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