File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Fixed Python 3.14 support when built without ``zstd `` support -- by :user: `JacobHenner `.
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ Ivan Lakovic
177177Ivan Larin
178178J. Nick Koston
179179Jacob Champion
180+ Jacob Henner
180181Jaesung Lee
181182Jake Davis
182183Jakob Ackermann
Original file line number Diff line number Diff line change 2121except ImportError :
2222 HAS_BROTLI = False
2323
24- if sys .version_info >= (3 , 14 ):
25- import compression .zstd # noqa: I900
24+ try :
25+ from compression .zstd import ( # type: ignore[import-not-found] # noqa: I900
26+ ZstdDecompressor ,
27+ )
2628
2729 HAS_ZSTD = True
28- else :
30+ except ImportError :
2931 try :
30- import zstandard
32+ from zstandard import ZstdDecompressor
3133
3234 HAS_ZSTD = True
3335 except ImportError :
3436 HAS_ZSTD = False
3537
38+
3639MAX_SYNC_CHUNK_SIZE = 1024
3740
3841
@@ -297,13 +300,10 @@ def __init__(self) -> None:
297300 "The zstd decompression is not available. "
298301 "Please install `zstandard` module"
299302 )
300- if sys .version_info >= (3 , 14 ):
301- self ._obj = compression .zstd .ZstdDecompressor ()
302- else :
303- self ._obj = zstandard .ZstdDecompressor ()
303+ self ._obj = ZstdDecompressor ()
304304
305305 def decompress_sync (self , data : bytes ) -> bytes :
306- return self ._obj .decompress (data )
306+ return self ._obj .decompress (data ) # type: ignore[no-any-return]
307307
308308 def flush (self ) -> bytes :
309309 return b""
You can’t perform that action at this time.
0 commit comments