~hltbra/pyflakes/py3k-convertable

« back to all changes in this revision

Viewing changes to pyflakes/checker.py

  • Committer: exarkun
  • Date: 2010-04-03 13:46:54 UTC
  • Revision ID: importd@pear-20100403134654-x4qdgcc0la2tjf1t
Merge pyflakes-class-name-binding-2999

Author: exarkun
Reviewer: jesstess, mithrandi
Fixes: #2999

Fix a bug in the checker's handling of class names which caused
a class's own binding to be considered valid within the definition
of the class itself.

Now the binding is only valid after the class definition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- test-case-name: pyflakes -*-
2
 
# (c) 2005-2008 Divmod, Inc.
 
2
# (c) 2005-2010 Divmod, Inc.
3
3
# See LICENSE file for details
4
4
 
5
5
import __builtin__
479
479
            self.handleChildren(node.decorators)
480
480
        for baseNode in node.bases:
481
481
            self.handleNode(baseNode, node)
482
 
        self.addBinding(node.lineno, Binding(node.name, node))
483
482
        self.pushClassScope()
484
483
        self.handleChildren(node.code)
485
484
        self.popScope()
 
485
        self.addBinding(node.lineno, Binding(node.name, node))
486
486
 
487
487
 
488
488
    def ASSNAME(self, node):