Commits

Victor Stinner committed b316361

visit_list() requires a list of AST nodes

Comments (0)

Files changed (1)

astoptimizer/optimizer.py

             for name in node.names:
                 self.namespace.unassign(name)
 
-    def visit_Global(self, node):
+    def fullvisit_Global(self, node):
         for name in node.names:
             self.namespace.unassign(name)
 
     def visit_list(self, node_list, conditional=False):
         new_node_list = []
         for node in node_list:
-            if not isinstance(node, ast.AST):
-                new_node_list.append(node)
-                continue
-
             new_node = self.visit(node, conditional=conditional)
             if new_node is None:
                 continue