diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py index d5698f35..71b89d6c 100644 --- a/pre_commit/languages/python.py +++ b/pre_commit/languages/python.py @@ -1,6 +1,5 @@ from plumbum import local -import subprocess PY_ENV = 'py_env' @@ -17,21 +16,9 @@ def install_environment(): def run_hook(hook, file_args): - # TODO: batch filenames - process = subprocess.Popen( - ['bash', '-c', ' '.join( - ['source {0}/bin/activate &&'.format(PY_ENV)] + - [hook['entry']] + hook.get('args', []) + list(file_args) - )], - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - ) - ret = process.communicate() - - return (process.returncode,) + ret - return local['bash'][ '-c', ' '.join( ['source {0}/bin/activate &&'.format(PY_ENV)] + [hook['entry']] + hook.get('args', []) + list(file_args) ) - ].run() \ No newline at end of file + ].run()