Messages in this thread Patch in this message | | | Date | Fri, 2 Mar 2018 08:34:12 -0800 | From | Matthew Wilcox <> | Subject | Re: [PATCH v2] Documentation/sphinx: Fix Directive import error |
| |
On Fri, Mar 02, 2018 at 04:28:31PM +0100, Takashi Iwai wrote: > from docutils.parsers.rst import directives > -from sphinx.util.compat import Directive > +try: > + from docutils.parsers.rst import directives, Directive
We also don't need 'directives' on this line as it was imported on the previous line.
> +except ImportError: > + from sphinx.util.compat import Directive > from sphinx.ext.autodoc import AutodocReporter > > __version__ = '1.0'
Here's what I tested on Debian:
+++ b/Documentation/sphinx/kerneldoc.py @@ -37,7 +37,10 @@ import glob from docutils import nodes, statemachine from docutils.statemachine import ViewList from docutils.parsers.rst import directives -from sphinx.util.compat import Directive +try: + from docutils.parsers.rst import Directive +except ImportError: + from sphinx.util.compat import Directive from sphinx.ext.autodoc import AutodocReporter __version__ = '1.0'
| |