24 lines
984 B
Diff
24 lines
984 B
Diff
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:
|