mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 23:54:17 +00:00
more py3 fixes
This commit is contained in:
parent
232fc33060
commit
0ac0cec20f
3 changed files with 4 additions and 3 deletions
|
|
@ -182,7 +182,8 @@ def get_code_complexity(code, min=7, filename='stdin'):
|
||||||
complex = []
|
complex = []
|
||||||
try:
|
try:
|
||||||
ast = parse(code)
|
ast = parse(code)
|
||||||
except AttributeError as e:
|
except AttributeError:
|
||||||
|
e = sys.exc_info()[1]
|
||||||
sys.stderr.write("Unable to parse %s: %s\n" % (filename, e))
|
sys.stderr.write("Unable to parse %s: %s\n" % (filename, e))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ class Checker(object):
|
||||||
finally:
|
finally:
|
||||||
self.nodeDepth -= 1
|
self.nodeDepth -= 1
|
||||||
if self.traceTree:
|
if self.traceTree:
|
||||||
print (' ' * self.nodeDepth + 'end ' + node.__class__.__name__)
|
print(' ' * self.nodeDepth + 'end ' + node.__class__.__name__)
|
||||||
|
|
||||||
def ignore(self, node):
|
def ignore(self, node):
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ def main():
|
||||||
|
|
||||||
def _get_files(repo, **kwargs):
|
def _get_files(repo, **kwargs):
|
||||||
seen = set()
|
seen = set()
|
||||||
for rev in xrange(repo[kwargs['node']], len(repo)):
|
for rev in range(repo[kwargs['node']], len(repo)):
|
||||||
for file_ in repo[rev].files():
|
for file_ in repo[rev].files():
|
||||||
file_ = os.path.join(repo.root, file_)
|
file_ = os.path.join(repo.root, file_)
|
||||||
if file_ in seen or not os.path.exists(file_):
|
if file_ in seen or not os.path.exists(file_):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue