Skip to content

Commit

Permalink
chore: loosen cramjam version constraint to >=2.5.0 (#1145)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski authored Feb 23, 2024
1 parent d246424 commit ef251ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ classifiers = [
]
dependencies = [
"awkward>=2.4.6",
"cramjam>=2.8.1",
"cramjam>=2.5.0",
"importlib-metadata;python_version<\"3.8\"",
"numpy",
"fsspec",
Expand Down
10 changes: 4 additions & 6 deletions src/uproot/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ def decompress(self, data: bytes, uncompressed_bytes=None) -> bytes:
getattr(cramjam, "experimental", None), "lzma", None
)
if lzma is None:
raise RuntimeError(
"lzma not found in the cramjam package! (requires cramjam >= 2.8.1)"
)
import lzma

return lzma.decompress(data)
if uncompressed_bytes is None:
raise ValueError(
"lzma decompression requires the number of uncompressed bytes"
Expand Down Expand Up @@ -226,9 +226,7 @@ def compress(self, data: bytes) -> bytes:
getattr(cramjam, "experimental", None), "lzma", None
)
if lzma is None:
raise RuntimeError(
"lzma not found in the cramjam package! (requires cramjam >= 2.8.1)"
)
import lzma
return lzma.compress(data, preset=self._level)


Expand Down

0 comments on commit ef251ef

Please sign in to comment.