mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Use SystemExit instead of PreCommitSystemExit
This commit is contained in:
parent
3f7e715c20
commit
a9e1940f7e
3 changed files with 4 additions and 10 deletions
|
|
@ -14,11 +14,6 @@ from pre_commit.errors import FatalError
|
|||
from pre_commit.store import Store
|
||||
|
||||
|
||||
# For testing purposes
|
||||
class PreCommitSystemExit(SystemExit):
|
||||
pass
|
||||
|
||||
|
||||
def _to_bytes(exc):
|
||||
try:
|
||||
return bytes(exc)
|
||||
|
|
@ -39,7 +34,7 @@ def _log_and_exit(msg, exc, formatted):
|
|||
with open(os.path.join(store.directory, 'pre-commit.log'), 'wb') as log:
|
||||
output.write(error_msg, stream=log)
|
||||
output.write_line(formatted, stream=log)
|
||||
raise PreCommitSystemExit(1)
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue