File: sphinx-4.2.patch

package info (click to toggle)
pyliblo 0.16.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 380 kB
  • sloc: python: 552; makefile: 22; sh: 6
file content (46 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From: Steve Langasek <steve.langasek@ubuntu.com>
Date: Sat, 15 Jun 2024 11:47:36 +0200
Subject: Compatibility with sphinx 4.2

Bug-Debian: https://bugs.debian.org/997324
Last-Update: 2021-11-17

Drop the monkey patching of PyClassmember; this no longer exists and
the monkey patching doesn't appear to change the output of the current
docs
---
 doc/conf.py | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/doc/conf.py b/doc/conf.py
index 9bf7066..dbb6a58 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -30,7 +30,7 @@ autodoc_default_flags = ['members', 'undoc-members']
 
 from sphinx.ext.autodoc import py_ext_sig_re
 from sphinx.util.docstrings import prepare_docstring
-from sphinx.domains.python import PyClassmember, PyObject, py_sig_re
+from sphinx.domains.python import PyObject, py_sig_re
 
 
 def process_docstring(app, what, name, obj, options, lines):
@@ -62,18 +62,6 @@ def process_signature(app, what, name, obj,
     return (signature, return_annotation)
 
 
-# monkey-patch PyClassmember.handle_signature() to replace __init__
-# with the class name.
-handle_signature_orig = PyClassmember.handle_signature
-def handle_signature(self, sig, signode):
-    if '__init__' in sig:
-        m = py_sig_re.match(sig)
-        name_prefix, name, arglist, retann = m.groups()
-        sig = sig.replace('__init__', name_prefix[:-1])
-    return handle_signature_orig(self, sig, signode)
-PyClassmember.handle_signature = handle_signature
-
-
 # prevent exception fields from collapsing
 PyObject.doc_field_types[2].can_collapse = False