# # # # # # # # # # # # # #
# CAPTAINHOOK IDENTIFIER  #
# # # # # # # # # # # # # #
from .utils import bash, python_files_for_commit

DEFAULT = 'on'


def run():
    "Check to see if python files are py3 compatible"
    errors = []
    for py_file in python_files_for_commit():
        b = bash('python3 -m py_compile {0}'.format(py_file))
        if b.err:
            errors.append(b.err.decode(encoding='UTF-8'))
    return "\n".join(errors)

# # # # # # # # # # # # # #
# CAPTAINHOOK IDENTIFIER  #
# # # # # # # # # # # # # #
from .utils import bash, python_files_for_commit

DEFAULT = 'on'


def run():
    "Check to see if python files are py3 compatible"
    errors = []
    for py_file in python_files_for_commit():
        b = bash('2to3 {file}'.format(file=py_file))
        errors.append(b.output.decode(encoding='UTF-8'))
    return "\n".join(errors)

Replace python3 compile action with 2to3 action