mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +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
|
@ -1107,7 +1107,7 @@ class ReadablePathTest(JoinablePathTest):
|
|||
p = P(self.base)
|
||||
q = p / "FILEa"
|
||||
given = set(p.glob("FILEa"))
|
||||
expect = {q} if q.exists() else set()
|
||||
expect = {q} if q.info.exists() else set()
|
||||
self.assertEqual(given, expect)
|
||||
self.assertEqual(set(p.glob("FILEa*")), set())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue