Skip to content

Commit d49fd8f

Browse files
authored
avoid lstrip
1 parent b75f248 commit d49fd8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

autodocsumm/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ def add_autosummary(self, relative_ref_paths=False):
310310
indent = ' '
311311

312312
for (documenter, _) in documenters:
313+
obj_ref_path = documenter.fullname
313314
if relative_ref_paths:
314-
obj_ref_path = documenter.fullname.lstrip(
315-
self.modname + '.')
316-
else:
317-
obj_ref_path = documenter.fullname
315+
modname = self.modname + "."
316+
if documenter.fullname.startswith(modname):
317+
obj_ref_path = documenter.fullname[len(modname):]
318318

319319
self.add_line(indent + '~' + obj_ref_path, sourcename)
320320

0 commit comments

Comments
 (0)