check cygwin mismatch earlier

This commit is contained in:
Anthony Sottile
2020-09-20 10:19:31 -07:00
parent 3e2b9dc91a
commit 91530f1005
7 changed files with 33 additions and 32 deletions

View File

@@ -7,14 +7,11 @@ from typing import Generator
import pre_commit.constants as C
from pre_commit import output
from pre_commit.errors import FatalError
from pre_commit.store import Store
from pre_commit.util import force_bytes
class FatalError(RuntimeError):
pass
def _log_and_exit(msg: str, exc: BaseException, formatted: str) -> None:
error_msg = f'{msg}: {type(exc).__name__}: '.encode() + force_bytes(exc)
output.write_line_b(error_msg)