commit:     37878ea5019d70e731af11167eb8c8a0542161ec
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri May 13 07:50:02 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri May 13 09:08:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37878ea5

dev-python/bottle: Enable py3.11

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

 dev-python/bottle/bottle-0.12.19-r1.ebuild         |  3 +-
 dev-python/bottle/files/bottle-0.12.19-py311.patch | 45 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/dev-python/bottle/bottle-0.12.19-r1.ebuild 
b/dev-python/bottle/bottle-0.12.19-r1.ebuild
index d5e33bff5880..fe4128cc4739 100644
--- a/dev-python/bottle/bottle-0.12.19-r1.ebuild
+++ b/dev-python/bottle/bottle-0.12.19-r1.ebuild
@@ -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 optfeature
 
@@ -30,6 +30,7 @@ BDEPEND="
 
 PATCHES=(
        "${FILESDIR}"/${PN}-0.12.8-py3.5-backport.patch
+       "${FILESDIR}"/${P}-py311.patch
 )
 
 python_prepare_all() {

diff --git a/dev-python/bottle/files/bottle-0.12.19-py311.patch 
b/dev-python/bottle/files/bottle-0.12.19-py311.patch
new file mode 100644
index 000000000000..c7c36c3a37ee
--- /dev/null
+++ b/dev-python/bottle/files/bottle-0.12.19-py311.patch
@@ -0,0 +1,45 @@
+From 232f671fd0a28d435550afc4e2a9fde63c9e0db2 Mon Sep 17 00:00:00 2001
+From: Riley Banks <[email protected]>
+Date: Sun, 11 Oct 2015 10:21:43 +0100
+Subject: [PATCH] Implement getargspec using inspect.Signature
+
+---
+ bottle.py | 20 +++++++++++++++++++-
+ 1 file changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/bottle.py b/bottle.py
+index 9806efd..18ed730 100644
+--- a/bottle.py
++++ b/bottle.py
+@@ -41,9 +41,27 @@ import base64, cgi, email.utils, functools, hmac, 
itertools, mimetypes,\
+ from datetime import date as datedate, datetime, timedelta
+ from tempfile import TemporaryFile
+ from traceback import format_exc, print_exc
+-from inspect import getargspec
+ from unicodedata import normalize
+ 
++# inspect.getargspec was removed in Python 3.6, use
++# Signature-based version where we can (Python 3.3+)
++try:
++    from inspect import signature
++    def getargspec(func):
++        params = signature(func).parameters
++        args, varargs, keywords, defaults = [], None, None, []
++        for name, param in params.items():
++            if param.kind == param.VAR_POSITIONAL:
++                varargs = name
++            elif param.kind == param.VAR_KEYWORD:
++                keywords = name
++            else:
++                args.append(name)
++                if param.default is not param.empty:
++                    defaults.append(param.default)
++        return (args, varargs, keywords, tuple(defaults) or defaults)
++except ImportError:
++    from inspect import getargspec
+ 
+ try: from simplejson import dumps as json_dumps, loads as json_lds
+ except ImportError: # pragma: no cover
+-- 
+2.35.1
+

Reply via email to