mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Replace five with six
This commit is contained in:
parent
cb8dd335f4
commit
c65a11ce3d
9 changed files with 27 additions and 57 deletions
|
|
@ -3,10 +3,11 @@ from __future__ import print_function
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import contextlib
|
||||
import io
|
||||
import os.path
|
||||
import traceback
|
||||
|
||||
import six
|
||||
|
||||
from pre_commit import five
|
||||
from pre_commit import output
|
||||
from pre_commit.errors import FatalError
|
||||
|
|
@ -22,7 +23,7 @@ def _to_bytes(exc):
|
|||
try:
|
||||
return bytes(exc)
|
||||
except Exception:
|
||||
return five.text(exc).encode('UTF-8')
|
||||
return six.text_type(exc).encode('UTF-8')
|
||||
|
||||
|
||||
def _log_and_exit(msg, exc, formatted):
|
||||
|
|
@ -35,7 +36,7 @@ def _log_and_exit(msg, exc, formatted):
|
|||
output.write_line('Check the log at ~/.pre-commit/pre-commit.log')
|
||||
store = Store()
|
||||
store.require_created()
|
||||
with io.open(os.path.join(store.directory, 'pre-commit.log'), 'wb') as log:
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue