Mercurial > public > mercurial-scm > hg-stable
diff hgdemandimport/demandimportpy2.py @ 33880:8fb5212652ec
demandimport: move HGDEMANDIMPORT test to __init__.py
The logic is now shared between demandimport{2,3}.
Differential Revision: https://phab.mercurial-scm.org/D445
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 18 Aug 2017 11:08:17 -0700 |
parents | 9cbbf9118c6c |
children | 670eb4fa1b86 |
line wrap: on
line diff
--- a/hgdemandimport/demandimportpy2.py Tue Aug 15 10:15:31 2017 -0700 +++ b/hgdemandimport/demandimportpy2.py Fri Aug 18 11:08:17 2017 -0700 @@ -28,7 +28,6 @@ import __builtin__ as builtins import contextlib -import os import sys contextmanager = contextlib.contextmanager @@ -285,8 +284,7 @@ def enable(): "enable global demand-loading of modules" - if os.environ.get('HGDEMANDIMPORT') != 'disable': - builtins.__import__ = _demandimport + builtins.__import__ = _demandimport def disable(): "disable global demand-loading of modules"