Skip to content

Commit

Permalink
Merge pull request pre-commit#2164 from pre-commit/py2-cleanup
Browse files Browse the repository at this point in the history
minor py2 cleanup for sys.stderr.buffer
  • Loading branch information
asottile authored Dec 21, 2021
2 parents bd787a9 + 3512e44 commit de177e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion testing/resources/docker_hooks_repo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM cogniteev/echo
FROM ubuntu:focal

CMD ["echo", "This is overwritten by the .pre-commit-hooks.yaml 'entry'"]
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions tests/languages/helpers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit de177e8

Please sign in to comment.