comparison doc/gendoc.py @ 27330:6fbf1159a85a

doc: make gendoc.py module import policy aware Without this, running gendoc.py during an install without C modules available (via `make local`) will result in an import failure because the default module load policy insists on C modules. We also remove the sys.path adjustment because it is no longer needed since our magic importer handles things.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 12 Dec 2015 13:23:29 -0500
parents e0c572d4d112
children f22cd17a22e7
comparison
equal deleted inserted replaced
27329:944af8e2eb4c 27330:6fbf1159a85a
2 2
3 where DOC is the name of a document 3 where DOC is the name of a document
4 """ 4 """
5 5
6 import os, sys, textwrap 6 import os, sys, textwrap
7
8 # This script is executed during installs and may not have C extensions
9 # available. Relax C module requirements.
10 os.environ['HGMODULEPOLICY'] = 'allow'
7 # import from the live mercurial repo 11 # import from the live mercurial repo
8 sys.path.insert(0, "..") 12 sys.path.insert(0, "..")
9 # fall back to pure modules if required C extensions are not available
10 sys.path.append(os.path.join('..', 'mercurial', 'pure'))
11 from mercurial import demandimport; demandimport.enable() 13 from mercurial import demandimport; demandimport.enable()
12 from mercurial import minirst 14 from mercurial import minirst
13 from mercurial.commands import table, globalopts 15 from mercurial.commands import table, globalopts
14 from mercurial.i18n import gettext, _ 16 from mercurial.i18n import gettext, _
15 from mercurial.help import helptable, loaddoc 17 from mercurial.help import helptable, loaddoc