Use inspect.signature instead of deprecated formatargspec
This commit is contained in:
parent
065f397aa9
commit
840a227035
23
sympy-signature.patch
Normal file
23
sympy-signature.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
From c800c12c035c1531f42342a535895db18c15c6b6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||||
|
Date: Fri, 17 Jun 2022 01:43:10 +0200
|
||||||
|
Subject: [PATCH] Use inspect.signature instead of deprecated formatargspec
|
||||||
|
|
||||||
|
---
|
||||||
|
doc/ext/docscrape.py | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/doc/ext/docscrape.py b/doc/ext/docscrape.py
|
||||||
|
index 6e94b4964c2..d0eeeed7e8b 100644
|
||||||
|
--- a/doc/ext/docscrape.py
|
||||||
|
+++ b/doc/ext/docscrape.py
|
||||||
|
@@ -462,8 +462,7 @@ def __init__(self, func, role='func', doc=None, config={}):
|
||||||
|
func, func_name = self.get_func()
|
||||||
|
try:
|
||||||
|
# try to read signature
|
||||||
|
- argspec = inspect.getfullargspec(func)
|
||||||
|
- argspec = inspect.formatargspec(*argspec)
|
||||||
|
+ argspec = str(inspect.signature(func))
|
||||||
|
argspec = argspec.replace('*', r'\*')
|
||||||
|
signature = '{}{}'.format(func_name, argspec)
|
||||||
|
except TypeError as e:
|
@ -15,6 +15,8 @@ Patch0: %{name}-circuitplot.patch
|
|||||||
Patch1: %{name}-tests.patch
|
Patch1: %{name}-tests.patch
|
||||||
# Don't let deprecation warnings from distutils cause test failures
|
# Don't let deprecation warnings from distutils cause test failures
|
||||||
Patch2: %{name}-distutils.patch
|
Patch2: %{name}-distutils.patch
|
||||||
|
# Use inspect.signature instead of deprecated formatargspec
|
||||||
|
Patch3: %{name}-signature.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user