Skip to content

Commit

Permalink
Delay import of Sphinx (#248)
Browse files Browse the repository at this point in the history
* Delay import of Sphinx

* ENH: do not import Sphinx unless it has already been imported

* Delay import of Sphinx

(cherry picked from commit 4978673)
  • Loading branch information
cgohlke authored and rgommers committed Dec 24, 2019
1 parent 8efdc7b commit 24cdd0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion numpydoc/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import copy
import sys

from sphinx.ext.autodoc import ALL

def strip_blank_lines(l):
"Remove leading and trailing blank lines from a list of lines"
Expand Down Expand Up @@ -626,6 +625,11 @@ def __init__(self, cls, doc=None, modulename='', func_doc=FunctionDoc,
raise ValueError("Expected a class or None, but got %r" % cls)
self._cls = cls

if 'sphinx' in sys.modules:
from sphinx.ext.autodoc import ALL
else:
ALL = object()

self.show_inherited_members = config.get(
'show_inherited_class_members', True)

Expand Down

0 comments on commit 24cdd0c

Please sign in to comment.