Replace removed inspect.formatargspec with inspect.signature

epel9
Tomáš Hrnčiar 3 years ago
parent 99bffed983
commit 4b4ca0c489

@ -0,0 +1,29 @@
From ec30ecf89f8788da139f73d9140de66fc21848d5 Mon Sep 17 00:00:00 2001
From: Hugo van Kemenade <hugovk@users.noreply.github.com>
Date: Thu, 30 Sep 2021 15:21:40 +0300
Subject: [PATCH] Replace deprecated inspect.formatargspec with
inspect.signature
---
botocore/docs/method.py | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/botocore/docs/method.py b/botocore/docs/method.py
index dbadd94313..e75a0e8e5c 100644
--- a/botocore/docs/method.py
+++ b/botocore/docs/method.py
@@ -96,13 +96,7 @@ def document_custom_signature(section, name, method,
:param exclude: The names of the parameters to exclude from
documentation.
"""
- argspec = inspect.getfullargspec(method)
- signature_params = inspect.formatargspec(
- args=argspec.args[1:],
- varargs=argspec.varargs,
- varkw=argspec.varkw,
- defaults=argspec.defaults
- )
+ signature_params = str(inspect.signature(method))
signature_params = signature_params.lstrip('(')
signature_params = signature_params.rstrip(')')
section.style.start_sphinx_py_method(name, signature_params)

@ -9,6 +9,10 @@ Summary: Low-level, data-driven core of boto 3
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/boto/botocore URL: https://github.com/boto/botocore
Source0: %{pypi_source} Source0: %{pypi_source}
# Replace removed inspect.formatargspec with inspect.signature
# This is needed for compatibility with Python 3.11 and
# can be removed once upstream PR is merged.
Patch2507: https://github.com/boto/botocore/pull/2507.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: pyproject-rpm-macros BuildRequires: pyproject-rpm-macros
@ -35,7 +39,7 @@ A low-level interface to a growing number of Amazon Web Services. The
botocore package is the foundation for the AWS CLI as well as boto3. botocore package is the foundation for the AWS CLI as well as boto3.
%prep %prep
%autosetup -n %{pypi_name}-%{version} -p0 %autosetup -n %{pypi_name}-%{version} -p1
rm -vr %{pypi_name}.egg-info rm -vr %{pypi_name}.egg-info
# Remove online tests # Remove online tests
rm -vr tests/integration rm -vr tests/integration

Loading…
Cancel
Save