summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib/test_pathlib_abc.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2025-02-24 19:07:54 (GMT)
committerGitHub <noreply@github.com>2025-02-24 19:07:54 (GMT)
commit48c84a400aa90014a16ceac92df4b0cf5ca6b3d4 (patch)
tree90585212559f310ffe7ece9eb9398460369ed494 /Lib/test/test_pathlib/test_pathlib_abc.py
parentd73d69e232ce848733517736b1761e7bd2478574 (diff)
downloadcpython-48c84a400aa90014a16ceac92df4b0cf5ca6b3d4.zip
cpython-48c84a400aa90014a16ceac92df4b0cf5ca6b3d4.tar.gz
cpython-48c84a400aa90014a16ceac92df4b0cf5ca6b3d4.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib_abc.py')
-rw-r--r--Lib/test/test_pathlib/test_pathlib_abc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib_abc.py b/Lib/test/test_pathlib/test_pathlib_abc.py
index ee4c2b5..68fe352 100644
--- a/Lib/test/test_pathlib/test_pathlib_abc.py
+++ b/Lib/test/test_pathlib/test_pathlib_abc.py
@@ -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())