more py3 fixes

This commit is contained in:
Tarek Ziade 2012-02-14 21:27:41 +01:00
parent 232fc33060
commit 0ac0cec20f
3 changed files with 4 additions and 3 deletions

View file

@ -182,7 +182,8 @@ def get_code_complexity(code, min=7, filename='stdin'):
complex = []
try:
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))
return 0

View file

@ -300,7 +300,7 @@ class Checker(object):
finally:
self.nodeDepth -= 1
if self.traceTree:
print (' ' * self.nodeDepth + 'end ' + node.__class__.__name__)
print(' ' * self.nodeDepth + 'end ' + node.__class__.__name__)
def ignore(self, node):
pass

View file

@ -60,7 +60,7 @@ def main():
def _get_files(repo, **kwargs):
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():
file_ = os.path.join(repo.root, file_)
if file_ in seen or not os.path.exists(file_):