summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-05-13 09:50:02 +0200
committerMichał Górny <mgorny@gentoo.org>2022-05-13 11:08:00 +0200
commit37878ea5019d70e731af11167eb8c8a0542161ec (patch)
tree989663285c8ca21ccc0e65d4f661510b5de3b380 /dev-python/bottle
parentdev-python/bottle: Use PEP517 build (diff)
downloadgentoo-37878ea5019d70e731af11167eb8c8a0542161ec.tar.gz
gentoo-37878ea5019d70e731af11167eb8c8a0542161ec.tar.bz2
gentoo-37878ea5019d70e731af11167eb8c8a0542161ec.zip
dev-python/bottle: Enable py3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/bottle')
-rw-r--r--dev-python/bottle/bottle-0.12.19-r1.ebuild3
-rw-r--r--dev-python/bottle/files/bottle-0.12.19-py311.patch45
2 files changed, 47 insertions, 1 deletions
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 <waultah@gmail.com>
+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
+