From 21d3fe04259d617da1e5204a635d1a5cac5e0efd Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Tue, 1 Jun 2021 17:50:27 +0300 Subject: dev-python/lz4: Bump to py3.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ekaterina Vaartis Closes: https://github.com/gentoo/gentoo/pull/21074 Signed-off-by: Michał Górny --- dev-python/lz4/files/lz4-3.1.3-310-readall.patch | 32 ++++++++++++++++++++++++ dev-python/lz4/lz4-3.1.3.ebuild | 6 ++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 dev-python/lz4/files/lz4-3.1.3-310-readall.patch (limited to 'dev-python/lz4') 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 -- cgit v1.2.3-65-gdbad