mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-08 14:04:16 +00:00
cleanup
This commit is contained in:
parent
fde77e2168
commit
cf16bf82b9
2 changed files with 5 additions and 10 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue