runrst: try to be more helpful if docutils is not installed stable
authorNicolas Dumazet <nicdumz.commits@gmail.com>
Fri, 30 Jul 2010 14:41:47 +0900
branchstable
changeset 11707 13d79a7bf5b7
parent 11704 18c47562d331
child 11709 3e561b6af810
runrst: try to be more helpful if docutils is not installed
doc/runrst
--- a/doc/runrst	Sat Jul 24 11:20:21 2010 +0300
+++ b/doc/runrst	Fri Jul 30 14:41:47 2010 +0900
@@ -13,9 +13,14 @@
 """
 
 import sys
-from docutils.parsers.rst import roles
-from docutils.core import publish_cmdline
-from docutils import nodes, utils
+try:
+    from docutils.parsers.rst import roles
+    from docutils.core import publish_cmdline
+    from docutils import nodes, utils
+except ImportError:
+    sys.stderr.write("abort: couldn't generate documentation: docutils "
+                     "module is missing\n")
+    sys.exit(-1)
 
 def role_hg(name, rawtext, text, lineno, inliner,
             options={}, content=[]):