mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-125413: pathlib ABCs: use caching path.info.exists()
when globbing (#130422)
Call `ReadablePath.info.exists()` rather than `ReadablePath.exists()` when globbing so that we use (or populate) the `info` cache.
This commit is contained in:
parent
d73d69e232
commit
48c84a400a
3 changed files with 9 additions and 10 deletions
|
@ -533,7 +533,9 @@ class _PathGlobber(_GlobberBase):
|
|||
"""Provides shell-style pattern matching and globbing for pathlib paths.
|
||||
"""
|
||||
|
||||
lexists = operator.methodcaller('exists', follow_symlinks=False)
|
||||
@staticmethod
|
||||
def lexists(path):
|
||||
return path.info.exists(follow_symlinks=False)
|
||||
|
||||
@staticmethod
|
||||
def scandir(path):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue