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 #270 from nsmith-/xrootd_forksafe
Browse files Browse the repository at this point in the history
Make XRootDSource fork-safe
  • Loading branch information
jpivarski committed Apr 25, 2019
2 parents 818e15d + ca54770 commit fc40682
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions uproot/source/xrootd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# BSD 3-Clause License; see https://github.com/scikit-hep/uproot/blob/master/LICENSE

import os
import threading

import numpy
Expand All @@ -21,6 +22,7 @@ def __init__(self, path, timeout=None, *args, **kwds):

def _open(self):
try:
os.environ["XRD_RUNFORKHANDLER"] = "1" # To make uproot + xrootd + multiprocessing work
import pyxrootd.client
except ImportError:
raise ImportError("Install pyxrootd package with:\n conda install -c conda-forge xrootd\n(or download from http://xrootd.org/dload.html and manually compile with cmake; setting PYTHONPATH and LD_LIBRARY_PATH appropriately).")
Expand Down

0 comments on commit fc40682

Please sign in to comment.