From 6b62ec47e8af3ff650ce9516f79805e90c1847e3 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 14 Mar 2014 00:30:26 -0700 Subject: [PATCH] Performance hack --- pre_commit/languages/python.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) 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()