From: Martin Weinelt Date: Mon, 18 Jul 2022 11:58:55 +0000 (+0200) Subject: docs: fix build with sphinx 5.0 X-Git-Tag: 3.0.16~4^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ebff3a8392f002100d1e71d3deb94f27fb8cc0cf;p=thirdparty%2Fpsycopg.git docs: fix build with sphinx 5.0 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 --- diff --git a/docs/lib/pg3_docs.py b/docs/lib/pg3_docs.py index e2609a3ab..05a68762c 100644 --- a/docs/lib/pg3_docs.py +++ b/docs/lib/pg3_docs.py @@ -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)