From 7d7f11ccd7f7b84898a247cc15263fcf737b9fae Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Wed, 10 May 2017 16:43:53 +0200 Subject: [PATCH] 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 ? --- numpydoc/docscrape_sphinx.py | 3 --- numpydoc/tests/test_docscrape.py | 2 -- 2 files changed, 5 deletions(-) diff --git a/numpydoc/docscrape_sphinx.py b/numpydoc/docscrape_sphinx.py index 80d3abaa..d8a495e0 100644 --- a/numpydoc/docscrape_sphinx.py +++ b/numpydoc/docscrape_sphinx.py @@ -137,9 +137,6 @@ def _str_member_list(self, name): others.append((param, param_type, desc)) if autosum: - out += ['.. currentmodule:: ' - + self._obj.__module__ + '.' + self._obj.__name__] - out += [] out += ['.. autosummary::'] if self.class_members_toctree: out += [' :toctree:'] diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index a7ebdb0b..b71d7bf6 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -904,8 +904,6 @@ def x(self): .. rubric:: Attributes - .. currentmodule:: test_docscrape.Foo - .. autosummary:: :toctree: