changeset 32404:b2b5605285ec

demandimport: strictly check missing locals argument locals may be an empty dict.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 20 May 2017 15:09:14 +0900
parents 7cd1fa9dfd74
children 8e0327dae3f4
files mercurial/demandimport.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: