Merge pull request #2164 from pre-commit/py2-cleanup

minor py2 cleanup for sys.stderr.buffer
This commit is contained in:
Anthony Sottile 2021-12-20 22:03:16 -05:00 committed by GitHub
commit de177e8850
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -1,3 +1,3 @@
FROM cogniteev/echo
FROM ubuntu:focal
CMD ["echo", "This is overwritten by the .pre-commit-hooks.yaml 'entry'"]

View file

@ -1,8 +1,8 @@
- id: echo-entrypoint
name: echo (via --entrypoint)
language: docker_image
entry: --entrypoint echo cogniteev/echo
entry: --entrypoint echo ubuntu:focal
- id: echo-cmd
name: echo (via cmd)
language: docker_image
entry: cogniteev/echo echo
entry: ubuntu:focal echo

View file

@ -72,8 +72,8 @@ def test_basic_healthy():
def test_failed_setup_command_does_not_unicode_error():
script = (
'import sys\n'
"getattr(sys.stderr, 'buffer', sys.stderr).write(b'\\x81\\xfe')\n"
'exit(1)\n'
"sys.stderr.buffer.write(b'\\x81\\xfe')\n"
'raise SystemExit(1)\n'
)
# an assertion that this does not raise `UnicodeError`