]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs: fix build with sphinx 5.0
authorMartin Weinelt <hexa@darmstadt.ccc.de>
Mon, 18 Jul 2022 11:58:55 +0000 (13:58 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 18 Jul 2022 23:41:31 +0000 (00:41 +0100)
The `no_docstring` argument to `Documenter.add_content()` has been
deprecated in Sphinx 3.4.0 and removed in Sphinx 5.0.

This will not break compatibility with earlier versions, since the
`no_docstring` argument always carried a default value.

https://github.com/sphinx-doc/sphinx/blob/v4.2.0/sphinx/ext/autodoc/__init__.py#L601
https://github.com/sphinx-doc/sphinx/blob/v4.5.0/sphinx/ext/autodoc/__init__.py#L596

docs/lib/pg3_docs.py

index e2609a3ab9000a26a447ff9dcc27ee04b0b98a39..05a68762c43bb0b19217a6875a2588cb9b58638d 100644 (file)
@@ -97,7 +97,7 @@ def monkeypatch_autodoc():
             return recovered_classes[self.parent]
         return orig_attr_get_real_modname(self)
 
-    def fixed_attr_add_content(self, more_content, no_docstring=False):
+    def fixed_attr_add_content(self, more_content):
         """
         Replace a docstring such as::
 
@@ -119,7 +119,7 @@ def monkeypatch_autodoc():
         which creates a more compact representation of a property.
 
         """
-        orig_attr_add_content(self, more_content, no_docstring)
+        orig_attr_add_content(self, more_content)
         if not isinstance(self.object, property):
             return
         iret, mret = match_in_lines(r"\s*:rtype: (.*)", self.directive.result)