# HG changeset patch # User Gregory Szorc # Date 2015-11-22 06:28:01 # Node ID 4e554a7df1e977735cf4143c590d768a9fb69b39 # Parent 9eeca021a80337e04734c608241e85557c0b1ecf demandimport: don't enable when running under PyPy On demand importing doesn't work with PyPy for some reason. Don't honor requests to enable demand importing when running under PyPy. diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py --- a/mercurial/demandimport.py +++ b/mercurial/demandimport.py @@ -245,6 +245,10 @@ def isenabled(): def enable(): "enable global demand-loading of modules" + # PyPy doesn't work with demand import. + if '__pypy__' in sys.builtin_module_names: + return + if os.environ.get('HGDEMANDIMPORT') != 'disable': builtins.__import__ = _demandimport