mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Reorganize output writing
This commit is contained in:
parent
1adfa24124
commit
0dda19f691
20 changed files with 202 additions and 142 deletions
|
|
@ -66,5 +66,13 @@ def get_hook_message(
|
|||
stdout_byte_stream = getattr(sys.stdout, 'buffer', sys.stdout)
|
||||
|
||||
|
||||
def sys_stdout_write_wrapper(s, stream=stdout_byte_stream):
|
||||
def write(s, stream=stdout_byte_stream):
|
||||
stream.write(five.to_bytes(s))
|
||||
stream.flush()
|
||||
|
||||
|
||||
def write_line(s=None, stream=stdout_byte_stream):
|
||||
if s is not None:
|
||||
stream.write(five.to_bytes(s))
|
||||
stream.write(b'\n')
|
||||
stream.flush()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue