DOC,MAINT: remove use of inspect.formatargspec dusing doc build (#17301)
authorTirth Patel <tirthasheshpatel@gmail.com>
Fri, 28 Oct 2022 10:52:43 +0000 (03:52 -0700)
committerJochen Sprickerhof <jspricke@debian.org>
Tue, 3 Jan 2023 20:59:59 +0000 (20:59 +0000)
Gbp-Pq: Name 0020-DOC-MAINT-remove-use-of-inspect.formatargspec-dusing.patch

doc/source/scipyoptdoc.py

index 75cd42d686d2c0b956cf9f4a8c2cd8a2b4ad62ac..d02c534ff69af61e6e6c3b0db9949741a6b7f2c8 100644 (file)
@@ -20,10 +20,9 @@ Produces output similar to autodoc, except
 - See Also link to the actual function documentation is inserted
 
 """
-import os, sys, re, pydoc
+import sys, pydoc
 import sphinx
 import inspect
-import collections
 import textwrap
 import warnings
 
@@ -125,8 +124,7 @@ def wrap_mangling_directive(base_directive):
             # XXX deprecation that we should fix someday using Signature (?)
             with warnings.catch_warnings(record=True):
                 warnings.simplefilter('ignore')
-                signature = inspect.formatargspec(
-                    args, varargs, keywords, defaults)
+                signature = str(inspect.signature(obj))
 
             # Produce output
             self.options['noindex'] = True