mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-06 23:39:13 -05:00
Allow arbitrary bytes in output. Resolves #245
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def func():
|
||||
# Intentionally write mixed encoding to the output. This should not crash
|
||||
# pre-commit and should write bytes to the output.
|
||||
sys.stdout.buffer.write('☃'.encode('UTF-8') + '²'.encode('latin1') + b'\n')
|
||||
# Return 1 to trigger printing
|
||||
return 1
|
||||
Reference in New Issue
Block a user