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 #308 from scikit-hep/xxhash-fix
Browse files Browse the repository at this point in the history
Fixed xxhash import error
  • Loading branch information
jpivarski committed Jul 30, 2019
2 parents f03ced4 + 6462bd2 commit b67b57c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion uproot/source/compressed.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from copy import copy

import numpy
import xxhash

import uproot.const
import uproot.source.source
Expand Down Expand Up @@ -129,6 +128,10 @@ def _prepare(self):
elif algo == b"XZ":
compression = self.compression.copy(uproot.const.kLZMA)
elif algo == b"L4":
try:
import xxhash
except ImportError:
raise ImportError("Install xxhash package with:\n pip install xxhash\nor\n conda install -c conda-forge python-xxhash")
compression = self.compression.copy(uproot.const.kLZ4)
compressedbytes -= 8
checksum = cursor.field(self._compressed, self._format_field0)
Expand Down

0 comments on commit b67b57c

Please sign in to comment.