when uid_func_mapping specified using argument, reset it afterward stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 04 Mar 2010 12:11:30 +0100
branchstable
changeset 498 9c06e009010b
parent 497 c0461bf2bf24
child 499 583427b3646c
when uid_func_mapping specified using argument, reset it afterward
analyze.py
--- a/analyze.py	Thu Mar 04 12:11:28 2010 +0100
+++ b/analyze.py	Thu Mar 04 12:11:30 2010 +0100
@@ -368,12 +368,15 @@
     def visit(self, node, uid_func_mapping=None, kwargs=None, debug=False):
         # FIXME: not thread safe
         self.debug = debug
-        if uid_func_mapping:
+        if uid_func_mapping is not None:
             assert len(uid_func_mapping) <= 1
             self.uid_func_mapping = uid_func_mapping
             self.uid_func = uid_func_mapping.values()[0]
         self.kwargs = kwargs
         self._visit(node)
+        if uid_func_mapping is not None:
+            self.uid_func_mapping = None
+            self.uid_func = None
 
     def visit_union(self, node):
         for select in node.children: