mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/lz4: Bump to py3.10
Signed-off-by: Ekaterina Vaartis <vaartis@kotobank.ch> Closes: https://github.com/gentoo/gentoo/pull/21074 Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
committed by
Michał Górny
parent
e0908b325e
commit
21d3fe0425
32
dev-python/lz4/files/lz4-3.1.3-310-readall.patch
Normal file
32
dev-python/lz4/files/lz4-3.1.3-310-readall.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
diff --git a/lz4/frame/__init__.py b/lz4/frame/__init__.py
|
||||
index 5fa03ce..b77c425 100644
|
||||
--- a/lz4/frame/__init__.py
|
||||
+++ b/lz4/frame/__init__.py
|
||||
@@ -617,6 +617,17 @@ class LZ4FrameFile(_compression.BaseStream):
|
||||
# returns at least one byte (except at EOF)
|
||||
return self._buffer.peek(size)
|
||||
|
||||
+ def readall(self):
|
||||
+ chunks = bytearray()
|
||||
+
|
||||
+ while True:
|
||||
+ data = self.read(io.DEFAULT_BUFFER_SIZE)
|
||||
+ chunks += data
|
||||
+ if not data:
|
||||
+ break
|
||||
+
|
||||
+ return bytes(chunks)
|
||||
+
|
||||
def read(self, size=-1):
|
||||
"""Read up to ``size`` uncompressed bytes from the file.
|
||||
|
||||
@@ -632,6 +643,9 @@ class LZ4FrameFile(_compression.BaseStream):
|
||||
|
||||
"""
|
||||
self._check_can_read()
|
||||
+
|
||||
+ if size < 0 and sys.version_info >= (3, 10):
|
||||
+ return self.readall()
|
||||
return self._buffer.read(size)
|
||||
|
||||
def read1(self, size=-1):
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{7..9} )
|
||||
PYTHON_COMPAT=( python3_{7..10} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
@@ -25,4 +25,8 @@ BDEPEND="
|
||||
)
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${P}-310-readall.patch"
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
Reference in New Issue
Block a user