+ proc = subprocess.Popen(['git', 'diff', '--name-only', '--cached'], stdout=subprocess.PIPE)
+ staged_files = proc.stdout.readlines()
+ staged_files = [f.decode('utf-8') for f in staged_files]
+ staged_files = [f.strip() for f in staged_files]
+ staged_files = [f for f in staged_files if f.endswith('.py')]
+ out = subprocess.check_output((sys.executable, '-m', 'pytest', '--pep8',
+ '-m', 'pep8', '-n0', *staged),
+ stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ out = out.decode('utf8')
+ out = subprocess.check_output((sys.executable, '-m', 'pytest', 'tests'),
+ stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ out = out.decode('utf8')
+if __name__ == '__main__':