Skip to content

Commit 7d7f11c

Browse files
committed
Fix regression in #81
It seems #81 introduced some kind of bug: I have the following rst file documenting MyClass object from ottemplate module: ``` .. currentmodule:: ottemplate .. autosummary:: :toctree: _generated/ :template: class.rst_t MyClass ``` with class.rst_t: ``` {{ objname }} {{ underline }} .. currentmodule:: {{ module }} .. autoclass:: {{ objname }} {% block methods %} .. automethod:: __init__ {% endblock %} ``` results in the following error: ``` following exception was raised: Traceback (most recent call last): File "/home/schueller/.local/lib/python3.5/site-packages/sphinx/ext/autodoc.py", line 551, in import_object __import__(self.modname) ImportError: No module named 'ottemplate.ottemplate.MyClass'; 'ottemplate.ottemplate' is not a package ``` What do you think @sirno ?
1 parent 6df5c12 commit 7d7f11c

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

numpydoc/docscrape_sphinx.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ def _str_member_list(self, name):
137137
others.append((param, param_type, desc))
138138

139139
if autosum:
140-
out += ['.. currentmodule:: '
141-
+ self._obj.__module__ + '.' + self._obj.__name__]
142-
out += []
143140
out += ['.. autosummary::']
144141
if self.class_members_toctree:
145142
out += [' :toctree:']

numpydoc/tests/test_docscrape.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,6 @@ def x(self):
904904
905905
.. rubric:: Attributes
906906
907-
.. currentmodule:: test_docscrape.Foo
908-
909907
.. autosummary::
910908
:toctree:
911909

0 commit comments

Comments
 (0)