Patchwork [2,of,6,import-refactor,V3] check-seclevel: set module load policy to Python only

mail settings
Submitter Gregory Szorc
Date Dec. 4, 2015, 5:51 a.m.
Message ID <e7f2cafddb61f893011f.1449208268@ubuntu-main>
Download mbox | patch
Permalink /patch/11800/
State Accepted
Delegated to: Yuya Nishihara
Headers show


Gregory Szorc - Dec. 4, 2015, 5:51 a.m.
# HG changeset patch
# User Gregory Szorc <>
# Date 1448434435 28800
#      Tue Nov 24 22:53:55 2015 -0800
# Node ID e7f2cafddb61f893011f19927778eec255df4805
# Parent  6639f74c47892ea8ba2f4b1deb2100bf0d4a6454
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/ b/doc/
--- a/doc/
+++ b/doc/
@@ -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 import helptable
 from mercurial import extensions
 from mercurial import minirst
 from mercurial import ui as uimod
 level2mark = ['"', '=', '-', '.', '#']