doc: use modern import style in runrst
authorYuya Nishihara <yuya@tcha.org>
Thu, 06 Sep 2018 22:12:21 +0900
changeset 39489 4e4fae1dda5c
parent 39488 15e8250a82da
child 39490 b6db2e80a9ce
doc: use modern import style in runrst
doc/runrst
--- a/doc/runrst	Sun Aug 26 22:18:09 2018 +0900
+++ b/doc/runrst	Thu Sep 06 22:12:21 2018 +0900
@@ -12,11 +12,14 @@
 where WRITER is the name of a Docutils writer such as 'html' or 'manpage'
 """
 
+from __future__ import absolute_import
+
 import sys
 try:
-    from docutils.parsers.rst import roles
-    from docutils.core import publish_cmdline
-    from docutils import nodes, utils
+    import docutils.core as core
+    import docutils.nodes as nodes
+    import docutils.utils as utils
+    import docutils.parsers.rst.roles as roles
 except ImportError:
     sys.stderr.write("abort: couldn't generate documentation: docutils "
                      "module is missing\n")
@@ -58,4 +61,4 @@
     writer = sys.argv[1]
     del sys.argv[1]
 
-    publish_cmdline(writer_name=writer)
+    core.publish_cmdline(writer_name=writer)