Commits

Tarek Ziadé committed 47397d4

more py3 fixes

  • Participants
  • Parent commits eba1375
  • Branches python3

Comments (0)

Files changed (3)

File flake8/mccabe.py

     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
 

File flake8/pyflakes.py

         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

File flake8/run.py

 
 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_):