@@ -1,11 +1,11 @@
#!/usr/bin/env python
-# Wrapper for python2 and python3 around compileall to raise exception
-# when a python byte code generation failed.
-#
-# Inspired from:
-# http://stackoverflow.com/questions/615632/how-to-detect-errors-from-compileall-compile-dir
+'''Wrapper for python2 and python3 around compileall to raise exception
+when a python byte code generation failed.
+Inspired from:
+ http://stackoverflow.com/questions/615632/how-to-detect-errors-from-compileall-compile-dir
+'''
from __future__ import print_function
import sys
import py_compile
@@ -17,9 +17,9 @@ def check_for_errors(comparison):
otherwise perform comparison as expected.
'''
def operator(self, other):
- type, value, traceback = sys.exc_info()
- if type is not None and issubclass(type,
- py_compile.PyCompileError):
+ exc_type, value, traceback = sys.exc_info()
+ if exc_type is not None and issubclass(exc_type,
+ py_compile.PyCompileError):
print("Cannot compile %s" % value.file)
raise value
@@ -28,9 +28,9 @@ def check_for_errors(comparison):
return operator
class ReportProblem(int):
- '''Class that pretends to be an int() object but iplements all of its
- comparisong operators such that it'd detect being called in
- PyCompileError hadnling context and abort execution
+ '''Class that pretends to be an int() object but implements all of its
+ comparison operators such that it'd detect being called in
+ PyCompileError handling context and abort execution
'''
VALUE = 1