[PATCH stable] build: fix hgrc manpage building with docutils 0.9
Nikolaj Sjujskij
sterkrig at myopera.com
Tue May 8 15:24:35 CDT 2012
# HG changeset patch
# User Nikolaj Sjujskij <sterkrig at myopera.com>
# Date 1336507179 -14400
# Branch stable
# Node ID 85f1a167a49d4ef3ed57dbf324f48bbbd7d5ac6b
# Parent 20a9d823f242f00c3b8c2f0d7ce4c4e081cf11eb
build: fix hgrc manpage building with docutils 0.9
Since docutils 0.9, `roman` module has been moved from module directory root
(i.e. `site-packages/roman.py`) to `docutils.utils` module. Therefore `import
roman` statement should be wrapped in `try: ... except ImportError: ...` block
to handle importing correctly.
diff --git a/doc/hgmanpage.py b/doc/hgmanpage.py
--- a/doc/hgmanpage.py
+++ b/doc/hgmanpage.py
@@ -47,7 +47,10 @@
import re
from docutils import nodes, writers, languages
-import roman
+try:
+ import roman
+except ImportError:
+ from docutils.utils import roman
import inspect
FIELD_LIST_INDENT = 7
More information about the Mercurial-devel
mailing list