public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/fastbencode/files/, dev-python/fastbencode/
@ 2023-08-06  7:47 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2023-08-06  7:47 UTC (permalink / raw
  To: gentoo-commits

commit:     be89891c1b251b307ab3182054abaf276810aab6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  6 07:24:35 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug  6 07:47:44 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be89891c

dev-python/fastbencode: Backport py3.12 fix

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/fastbencode/fastbencode-0.2.ebuild      |  7 ++++-
 .../fastbencode/files/fastbencode-0.2-py312.patch  | 35 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/dev-python/fastbencode/fastbencode-0.2.ebuild b/dev-python/fastbencode/fastbencode-0.2.ebuild
index f884ac6d4ab5..068bcff75e2d 100644
--- a/dev-python/fastbencode/fastbencode-0.2.ebuild
+++ b/dev-python/fastbencode/fastbencode-0.2.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 DISTUTILS_EXT=1
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..12} )
 
 inherit distutils-r1 pypi
 
@@ -25,6 +25,11 @@ BDEPEND="
 
 distutils_enable_tests unittest
 
+PATCHES=(
+	# https://github.com/breezy-team/fastbencode/commit/23e8cadcc81c6649d96742f235a98bd3047e5d8a
+	"${FILESDIR}"/${P}-py312.patch
+)
+
 python_test() {
 	cd fastbencode/tests || die
 	eunittest

diff --git a/dev-python/fastbencode/files/fastbencode-0.2-py312.patch b/dev-python/fastbencode/files/fastbencode-0.2-py312.patch
new file mode 100644
index 000000000000..78c42c7b2fa7
--- /dev/null
+++ b/dev-python/fastbencode/files/fastbencode-0.2-py312.patch
@@ -0,0 +1,35 @@
+From 23e8cadcc81c6649d96742f235a98bd3047e5d8a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@jelmer.uk>
+Date: Tue, 11 Jul 2023 11:45:47 +0000
+Subject: [PATCH] Fix compatibility with python 3.12
+
+Fixes #23
+---
+ fastbencode/tests/test_bencode.py | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/fastbencode/tests/test_bencode.py b/fastbencode/tests/test_bencode.py
+index 50e8e06..61cd8b5 100644
+--- a/fastbencode/tests/test_bencode.py
++++ b/fastbencode/tests/test_bencode.py
+@@ -287,10 +287,16 @@ def test_list(self):
+ 
+     def test_list_deepnested(self):
+         import platform
+-        if platform.python_implementation() == 'PyPy':
+-            self.skipTest('recursion not an issue on pypy')
+-        with RecursionLimit():
+-            self._run_check_error(RuntimeError, (b"l" * 100) + (b"e" * 100))
++        if (platform.python_implementation() == 'PyPy'
++                or sys.version_info[:2] >= (3, 12)):
++            expected = []
++            for i in range(99):
++                expected = [expected]
++            self._check(expected, (b"l" * 100) + (b"e" * 100))
++        else:
++            with RecursionLimit():
++                self._run_check_error(
++                    RuntimeError, (b"l" * 100) + (b"e" * 100))
+ 
+     def test_malformed_list(self):
+         self._run_check_error(ValueError, b'l')


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-06  7:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-06  7:47 [gentoo-commits] repo/gentoo:master commit in: dev-python/fastbencode/files/, dev-python/fastbencode/ Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox