Skip to content

Commit e3b9832

Browse files
authored
gh-98884: [pathlib] remove hasattr check for lru_cache (#98885)
1 parent e99c507 commit e3b9832

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Lib/pathlib.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def make_uri(self, path):
200200
# Globbing helpers
201201
#
202202

203+
@functools.lru_cache()
203204
def _make_selector(pattern_parts, flavour):
204205
pat = pattern_parts[0]
205206
child_parts = pattern_parts[1:]
@@ -215,9 +216,6 @@ def _make_selector(pattern_parts, flavour):
215216
cls = _PreciseSelector
216217
return cls(pat, child_parts, flavour)
217218

218-
if hasattr(functools, "lru_cache"):
219-
_make_selector = functools.lru_cache()(_make_selector)
220-
221219

222220
class _Selector:
223221
"""A selector matches a specific glob pattern part against the children

0 commit comments

Comments
 (0)