Skip to content

Commit e748c6b

Browse files
spec.py, AbstractFileSystem._ls_from_cache: Avoid looking up key in dircache twice (#1561)
--------- Co-authored-by: Martin Durant <[email protected]>
1 parent 2b87bff commit e748c6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: fsspec/spec.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,10 @@ def _ls_from_cache(self, path):
358358
but contains nothing), None if not in cache.
359359
"""
360360
parent = self._parent(path)
361-
if path.rstrip("/") in self.dircache:
361+
try:
362362
return self.dircache[path.rstrip("/")]
363+
except KeyError:
364+
pass
363365
try:
364366
files = [
365367
f

0 commit comments

Comments
 (0)