sphinx
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sun, 13 Nov 2022 10:36:51 +0000 (10:36 +0000)
committerGraham Inggs <ginggs@debian.org>
Sun, 13 Nov 2022 10:36:51 +0000 (10:36 +0000)
Replace sphinx's rpartition with python's in-built one (#43360)

Origin: upstream commit 4a14d064187367cacab3ff4652a12a0e45d0711b
Author: Alibi
Bug-Debian: https://bugs.debian.org/1013375

Gbp-Pq: Name 1013375sphinx.patch

doc/source/conf.py

index da022e5ac003f2bd7988507b47d528ce6c057bf8..344e30cf3242a334a6d60256417321dd06ae6fe2 100644 (file)
@@ -463,7 +463,6 @@ ipython_execlines = [
 # eg pandas.Series.str and pandas.Series.dt (see GH9322)
 
 import sphinx  # isort:skip
-from sphinx.util import rpartition  # isort:skip
 from sphinx.ext.autodoc import (  # isort:skip
     AttributeDocumenter,
     Documenter,
@@ -523,8 +522,8 @@ class AccessorLevelDocumenter(Documenter):
             # HACK: this is added in comparison to ClassLevelDocumenter
             # mod_cls still exists of class.accessor, so an extra
             # rpartition is needed
-            modname, accessor = rpartition(mod_cls, ".")
-            modname, cls = rpartition(modname, ".")
+            modname, _, accessor = mod_cls.rpartition(".")
+            modname, _, cls = modname.rpartition(".")
             parents = [cls, accessor]
             # if the module name is still missing, get it like above
             if not modname: