Skip to content

Commit ef251ef

Browse files
authored
chore: loosen cramjam version constraint to >=2.5.0 (#1145)
1 parent d246424 commit ef251ef

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ classifiers = [
3838
]
3939
dependencies = [
4040
"awkward>=2.4.6",
41-
"cramjam>=2.8.1",
41+
"cramjam>=2.5.0",
4242
"importlib-metadata;python_version<\"3.8\"",
4343
"numpy",
4444
"fsspec",

src/uproot/compression.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ def decompress(self, data: bytes, uncompressed_bytes=None) -> bytes:
179179
getattr(cramjam, "experimental", None), "lzma", None
180180
)
181181
if lzma is None:
182-
raise RuntimeError(
183-
"lzma not found in the cramjam package! (requires cramjam >= 2.8.1)"
184-
)
182+
import lzma
183+
184+
return lzma.decompress(data)
185185
if uncompressed_bytes is None:
186186
raise ValueError(
187187
"lzma decompression requires the number of uncompressed bytes"
@@ -226,9 +226,7 @@ def compress(self, data: bytes) -> bytes:
226226
getattr(cramjam, "experimental", None), "lzma", None
227227
)
228228
if lzma is None:
229-
raise RuntimeError(
230-
"lzma not found in the cramjam package! (requires cramjam >= 2.8.1)"
231-
)
229+
import lzma
232230
return lzma.compress(data, preset=self._level)
233231

234232

0 commit comments

Comments
 (0)