mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/py-ubjson: Enable py3.12
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
35
dev-python/py-ubjson/files/py-ubjson-0.16.1-py312.patch
Normal file
35
dev-python/py-ubjson/files/py-ubjson-0.16.1-py312.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 1e69041e86947e360f30b8ee5ee0993ddd68469c Mon Sep 17 00:00:00 2001
|
||||
From: Vilnis Termanis <vilnis.termanis@iotics.com>
|
||||
Date: Fri, 20 Oct 2023 17:10:10 +0200
|
||||
Subject: [PATCH] Fix recursion test case for Python 3.12
|
||||
|
||||
---
|
||||
test/test.py | 6 +++---
|
||||
3 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/test/test.py b/test/test.py
|
||||
index c3920c4..d685194 100644
|
||||
--- a/test/test.py
|
||||
+++ b/test/test.py
|
||||
@@ -465,10 +465,10 @@ def assert_raises_regex(self, *args, **kwargs):
|
||||
|
||||
def test_recursion(self):
|
||||
old_limit = getrecursionlimit()
|
||||
- setrecursionlimit(200)
|
||||
+ setrecursionlimit(100)
|
||||
try:
|
||||
obj = current = []
|
||||
- for _ in range(getrecursionlimit() * 2):
|
||||
+ for _ in range(getrecursionlimit() * 30):
|
||||
new_list = []
|
||||
current.append(new_list)
|
||||
current = new_list
|
||||
@@ -476,7 +476,7 @@ def test_recursion(self):
|
||||
with self.assert_raises_regex(RuntimeError, 'recursion'):
|
||||
self.ubjdumpb(obj)
|
||||
|
||||
- raw = ARRAY_START * (getrecursionlimit() * 2)
|
||||
+ raw = ARRAY_START * (getrecursionlimit() * 30)
|
||||
with self.assert_raises_regex(RuntimeError, 'recursion'):
|
||||
self.ubjloadb(raw)
|
||||
finally:
|
||||
@@ -6,7 +6,7 @@ EAPI=8
|
||||
DISTUTILS_EXT=1
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYPI_NO_NORMALIZE=1
|
||||
PYTHON_COMPAT=( python3_{9..11} )
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
|
||||
inherit distutils-r1 pypi
|
||||
|
||||
@@ -22,6 +22,11 @@ KEYWORDS="amd64 arm arm64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux"
|
||||
|
||||
distutils_enable_tests unittest
|
||||
|
||||
PATCHES=(
|
||||
# https://github.com/Iotic-Labs/py-ubjson/pull/19
|
||||
"${FILESDIR}/${P}-py312.patch"
|
||||
)
|
||||
|
||||
python_test() {
|
||||
eunittest -s test
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user