Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #293 from lgray/FileSource_futures
Browse files Browse the repository at this point in the history
Propagate FileSource futures setup to threadlocal
  • Loading branch information
jpivarski committed Jun 24, 2019
2 parents 2d7b0da + 1b6fb9b commit 349b3d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions uproot/source/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class FileSource(uproot.source.chunked.ChunkedSource):

def __init__(self, path, *args, **kwds):
self._size = None
self._parallel = kwds['parallel']
super(FileSource, self).__init__(os.path.expanduser(path), *args, **kwds)

def size(self):
Expand All @@ -31,6 +32,7 @@ def threadlocal(self):
out._chunkbytes = self._chunkbytes
out.cache = self.cache
out._source = None # local file connections are *not shared* among threads (they're *not* thread-safe)
out._setup_futures(self._parallel)
return out

def _open(self):
Expand Down

0 comments on commit 349b3d8

Please sign in to comment.