We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e10b818 commit fb15fa6Copy full SHA for fb15fa6
1 file changed
pre_commit/resources/hook-tmpl
@@ -170,16 +170,25 @@ def _opts(stdin):
170
return ('--config', CONFIG, '--hook-stage', stage) + fns[HOOK_TYPE](stdin)
171
172
173
+if sys.version_info < (3, 7): # https://bugs.python.org/issue25942
174
+ def _subprocess_call(cmd): # this is the python 2.7 implementation
175
+ return subprocess.Popen(cmd).wait()
176
+else:
177
+ _subprocess_call = subprocess.call
178
+
179
180
def main():
181
retv, stdin = _run_legacy()
182
try:
183
_validate_config()
- return retv | subprocess.call(_exe() + _opts(stdin))
184
+ return retv | _subprocess_call(_exe() + _opts(stdin))
185
except EarlyExit:
186
return retv
187
except FatalError as e:
188
print(e.args[0])
189
return 1
190
+ except KeyboardInterrupt:
191
+ return 1
192
193
194
if __name__ == '__main__':
0 commit comments