1000 # One 'global' statement can bind multiple (comma-delimited) names. |
1000 # One 'global' statement can bind multiple (comma-delimited) names. |
1001 for node_name in node.names: |
1001 for node_name in node.names: |
1002 node_value = Assignment(node_name, node) |
1002 node_value = Assignment(node_name, node) |
1003 |
1003 |
1004 # Remove UndefinedName messages already reported for this name. |
1004 # Remove UndefinedName messages already reported for this name. |
1005 # TODO: if the global is not used in this scope, it does not |
1005 # TO DO: if the global is not used in this scope, it does not |
1006 # become a globally defined name. See test_unused_global. |
1006 # become a globally defined name. See test_unused_global. |
1007 self.messages = [ |
1007 self.messages = [ |
1008 m for m in self.messages if not |
1008 m for m in self.messages if not |
1009 isinstance(m, messages.UndefinedName) or |
1009 isinstance(m, messages.UndefinedName) or |
1010 m.message_args[0] != node_name] |
1010 m.message_args[0] != node_name] |