--- a/mercurial/demandimport.py Thu May 18 18:01:48 2017 -0400
+++ b/mercurial/demandimport.py Sat May 20 15:09:14 2017 +0900
@@ -158,7 +158,7 @@
_pypy = '__pypy__' in sys.builtin_module_names
def _demandimport(name, globals=None, locals=None, fromlist=None, level=level):
- if not locals or name in ignore or fromlist == ('*',):
+ if locals is None or name in ignore or fromlist == ('*',):
# these cases we can't really delay
return _hgextimport(_import, name, globals, locals, fromlist, level)
elif not fromlist: