summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkaterina Vaartis <vaartis@kotobank.ch>2021-06-01 17:50:27 +0300
committerMichał Górny <mgorny@gentoo.org>2021-06-02 21:46:27 +0200
commit21d3fe04259d617da1e5204a635d1a5cac5e0efd (patch)
tree277564c151412186c824c8391abb854e2a438242 /dev-python/lz4
parentdev-python/pytest: Backport additional py3.10 fix (diff)
downloadgentoo-21d3fe04259d617da1e5204a635d1a5cac5e0efd.tar.gz
gentoo-21d3fe04259d617da1e5204a635d1a5cac5e0efd.tar.bz2
gentoo-21d3fe04259d617da1e5204a635d1a5cac5e0efd.zip
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>
Diffstat (limited to 'dev-python/lz4')
-rw-r--r--dev-python/lz4/files/lz4-3.1.3-310-readall.patch32
-rw-r--r--dev-python/lz4/lz4-3.1.3.ebuild6
2 files changed, 37 insertions, 1 deletions
diff --git a/dev-python/lz4/files/lz4-3.1.3-310-readall.patch b/dev-python/lz4/files/lz4-3.1.3-310-readall.patch
new file mode 100644
index 000000000000..63b306b4e4f3
--- /dev/null
+++ b/dev-python/lz4/files/lz4-3.1.3-310-readall.patch
@@ -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):
diff --git a/dev-python/lz4/lz4-3.1.3.ebuild b/dev-python/lz4/lz4-3.1.3.ebuild
index d0b08c54db09..b86d4cd56978 100644
--- a/dev-python/lz4/lz4-3.1.3.ebuild
+++ b/dev-python/lz4/lz4-3.1.3.ebuild
@@ -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