Commits

Anonymous committed 8c827de

handle exceptions while parsing with pep8

  • Participants
  • Parent commits da77669

Comments (0)

Files changed (1)

File hghooks/checkers.py

         sys.argv = ['pep8'] + files_to_check.keys() + extra_args
         options, args = pep8.process_options()
         sys.argv = old_args
+        extra_count = 0
         for path in args:
-            pep8.input_file(path)
+            try:
+                pep8.input_file(path)
+            except:
+                import traceback
+                traceback.print_exc()
+                extra_count += 1
 
-        return pep8.get_count()
+        return pep8.get_count() + extra_count
 
     return check_pep8