[PATCH 3 of 6 import-refactor V2] check-seclevel: set module load policy to Python only

Gregory Szorc gregory.szorc at gmail.com
Wed Nov 25 01:31:47 CST 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1448434435 28800
#      Tue Nov 24 22:53:55 2015 -0800
# Node ID 0dc3217bc6dd586230a900ea0b1b3f24b9c29e71
# Parent  18fcf978ddd46ba5df67210a8586051c77653b5f
check-seclevel: set module load policy to Python only

If we don't change this, the upcoming change to make the module
loading policy only load C modules will cause this script to fail if
run with CPython against an unbuilt source checkout.

diff --git a/doc/check-seclevel.py b/doc/check-seclevel.py
--- a/doc/check-seclevel.py
+++ b/doc/check-seclevel.py
@@ -1,19 +1,18 @@
 #!/usr/bin/env python
 #
 # checkseclevel - checking section title levels in each online help document
 
 import sys, os
 import optparse
 
 # import from the live mercurial repo
+os.environ['HGMODULEPOLICY'] = 'py'
 sys.path.insert(0, "..")
-# fall back to pure modules if required C extensions are not available
-sys.path.append(os.path.join('..', 'mercurial', 'pure'))
 from mercurial import demandimport; demandimport.enable()
 from mercurial.commands import table
 from mercurial.help import helptable
 from mercurial import extensions
 from mercurial import minirst
 from mercurial import ui as uimod
 
 level2mark = ['"', '=', '-', '.', '#']


More information about the Mercurial-devel mailing list