From 7dd99fb9652ffce50bf18ba18ccc4711f77e9f95 Mon Sep 17 00:00:00 2001 From: Luis Antonio Obis Aparicio Date: Sun, 15 Oct 2023 12:16:45 -0500 Subject: [PATCH] handle trivial executor --- src/uproot/source/fsspec.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/uproot/source/fsspec.py b/src/uproot/source/fsspec.py index 839196adf..201837157 100644 --- a/src/uproot/source/fsspec.py +++ b/src/uproot/source/fsspec.py @@ -140,7 +140,10 @@ def chunks( chunks = [] # _cat_file is async while cat_file is not - cat_file = self._fs._cat_file if self._fs.async_impl else self._fs.cat_file + is_async = ( + self._fs.async_impl and type(self._executor).__name__ == "LoopExecutor" + ) + cat_file = self._fs._cat_file if is_async else self._fs.cat_file for start, stop in ranges: future = self._executor.submit(cat_file, self._file_path, start, stop) chunk = uproot.source.chunk.Chunk(self, start, stop, future)