8
8
import sys
9
9
import warnings
10
10
from _collections_abc import Sequence
11
- from errno import EINVAL , ENOENT , ENOTDIR , EBADF , ELOOP
12
- from operator import attrgetter
11
+ from errno import ENOENT , ENOTDIR , EBADF , ELOOP
13
12
from stat import S_ISDIR , S_ISLNK , S_ISREG , S_ISSOCK , S_ISBLK , S_ISCHR , S_ISFIFO
14
13
from urllib .parse import quote_from_bytes as urlquote_from_bytes
15
14
@@ -364,7 +363,7 @@ def group(self, path):
364
363
#
365
364
# Globbing helpers
366
365
#
367
-
366
+ @ functools . lru_cache
368
367
def _make_selector (pattern_parts , flavour ):
369
368
pat = pattern_parts [0 ]
370
369
child_parts = pattern_parts [1 :]
@@ -378,9 +377,6 @@ def _make_selector(pattern_parts, flavour):
378
377
cls = _PreciseSelector
379
378
return cls (pat , child_parts , flavour )
380
379
381
- if hasattr (functools , "lru_cache" ):
382
- _make_selector = functools .lru_cache ()(_make_selector )
383
-
384
380
385
381
class _Selector :
386
382
"""A selector matches a specific glob pattern part against the children
@@ -693,11 +689,15 @@ def __ge__(self, other):
693
689
def __class_getitem__ (cls , type ):
694
690
return cls
695
691
696
- drive = property (attrgetter ('_drv' ),
697
- doc = """The drive prefix (letter or UNC path), if any.""" )
692
+ @property
693
+ def drive (self ):
694
+ """The drive prefix (letter or UNC path), if any."""
695
+ return self ._drv
698
696
699
- root = property (attrgetter ('_root' ),
700
- doc = """The root of the path, if any.""" )
697
+ @property
698
+ def root (self ):
699
+ """The root of the path, if any."""
700
+ return self ._root
701
701
702
702
@property
703
703
def anchor (self ):
0 commit comments