This commit is contained in:
Tarek Ziade 2012-02-21 13:04:01 +01:00
parent fde77e2168
commit cf16bf82b9
2 changed files with 5 additions and 10 deletions

View file

@ -46,7 +46,7 @@ class ASTVisitor:
"""Do preorder walk of tree using visitor"""
self.visitor = visitor
visitor.visit = self.dispatch
self.dispatch(tree, *args) # XXX *args make sense?
self.dispatch(tree, *args) # XXX *args make sense?
class PathNode:

View file

@ -3,13 +3,12 @@
# See LICENSE file for details
try:
import __builtin__
import __builtin__ # NOQA
except ImportError:
import builtins as __builtin__
import os.path
import _ast
import sys
from flake8 import messages
from flake8.util import skip_warning
@ -568,14 +567,10 @@ class Checker(object):
Check to see if any assignments have not been used.
"""
for name, binding in self.scope.items():
try:
if (not binding.used and not name in self.scope.globals
if (not binding.used and not name in self.scope.globals
and isinstance(binding, Assignment)):
self.report(messages.UnusedVariable,
binding.source.lineno, name)
except:
raise Exception(binding)
import pdb; pdb.set_trace()
self.report(messages.UnusedVariable,
binding.source.lineno, name)
self.deferAssignment(checkUnusedAssignments)
self.popScope()