Utilities/py3flakes/checker.py

changeset 689
8ed6155d4d65
parent 688
b4ea6261967a
child 791
9ec2ac20e54e
equal deleted inserted replaced
688:b4ea6261967a 689:8ed6155d4d65
316 lineno, value.name, self.scope[value.name].source.lineno) 316 lineno, value.name, self.scope[value.name].source.lineno)
317 317
318 if not isinstance(self.scope, ClassScope): 318 if not isinstance(self.scope, ClassScope):
319 for scope in self.scopeStack[::-1]: 319 for scope in self.scopeStack[::-1]:
320 existing = scope.get(value.name) 320 existing = scope.get(value.name)
321 if (isinstance(existing, Importation) 321 if isinstance(existing, Importation) and \
322 and not existing.used 322 not existing.used and \
323 and (not isinstance(value, Importation) or value.fullName == existing.fullName) 323 not isinstance(value, UnBinding) and \
324 and reportRedef): 324 (not isinstance(value, Importation) or \
325 325 value.fullName == existing.fullName) and \
326 reportRedef:
326 self.report(messages.RedefinedWhileUnused, 327 self.report(messages.RedefinedWhileUnused,
327 lineno, value.name, scope[value.name].source.lineno) 328 lineno, value.name, scope[value.name].source.lineno)
328 329
329 if isinstance(value, UnBinding): 330 if isinstance(value, UnBinding):
330 try: 331 try:

eric ide

mercurial