mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-08-24 18:58:08 -07:00
dev-python/cherrypy: Enable py3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{8..10} pypy3 )
|
||||
PYTHON_COMPAT=( python3_{8..11} pypy3 )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
@@ -52,6 +52,7 @@ python_prepare_all() {
|
||||
local PATCHES=(
|
||||
# https://github.com/cherrypy/cherrypy/pull/1946
|
||||
"${FILESDIR}"/${P}-close-files.patch
|
||||
"${FILESDIR}"/${P}-py311.patch
|
||||
)
|
||||
|
||||
sed -r -e '/(pytest-sugar|pytest-cov)/ d' \
|
||||
@@ -64,3 +65,14 @@ python_prepare_all() {
|
||||
|
||||
distutils-r1_python_prepare_all
|
||||
}
|
||||
|
||||
python_test() {
|
||||
local EPYTEST_DESELECT=()
|
||||
[[ ${EPYTHON} == python3.11 ]] && EPYTEST_DESELECT+=(
|
||||
# broken by changes in traceback output
|
||||
cherrypy/test/test_request_obj.py::RequestObjectTests::testErrorHandling
|
||||
cherrypy/test/test_tools.py::ToolTests::testHookErrors
|
||||
)
|
||||
|
||||
epytest
|
||||
}
|
||||
|
||||
32
dev-python/cherrypy/files/cherrypy-18.6.1-py311.patch
Normal file
32
dev-python/cherrypy/files/cherrypy-18.6.1-py311.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 8245a74aa4e090c40445535a9ce3997ed9904798 Mon Sep 17 00:00:00 2001
|
||||
From: Dominic Davis-Foster <dominic@davis-foster.co.uk>
|
||||
Date: Fri, 28 Jan 2022 23:11:52 +0000
|
||||
Subject: [PATCH] Switch from inspect.getargspec to inspect.getfullargspec
|
||||
|
||||
inspect.getargspec has been deprecated since 3.0
|
||||
---
|
||||
cherrypy/_cpdispatch.py | 8 ++------
|
||||
1 file changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/cherrypy/_cpdispatch.py b/cherrypy/_cpdispatch.py
|
||||
index 83eb79cb..5c506e99 100644
|
||||
--- a/cherrypy/_cpdispatch.py
|
||||
+++ b/cherrypy/_cpdispatch.py
|
||||
@@ -206,12 +206,8 @@ except ImportError:
|
||||
def test_callable_spec(callable, args, kwargs): # noqa: F811
|
||||
return None
|
||||
else:
|
||||
- getargspec = inspect.getargspec
|
||||
- # Python 3 requires using getfullargspec if
|
||||
- # keyword-only arguments are present
|
||||
- if hasattr(inspect, 'getfullargspec'):
|
||||
- def getargspec(callable):
|
||||
- return inspect.getfullargspec(callable)[:4]
|
||||
+ def getargspec(callable):
|
||||
+ return inspect.getfullargspec(callable)[:4]
|
||||
|
||||
|
||||
class LateParamPageHandler(PageHandler):
|
||||
--
|
||||
2.35.1
|
||||
|
||||
Reference in New Issue
Block a user