Skip to content

Commit

Permalink
Adapt stderr output to Git subprocess encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Dec 25, 2022
1 parent a8b67ce commit 6379342
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/darker/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ def _git_check_output(
if not exit_on_error:
raise
if exc_info.returncode != 128:
sys.stderr.buffer.write(exc_info.stderr)
err = sys.stderr if encoding else sys.stderr.buffer
err.write(exc_info.stderr)
raise

# Bad revision or another Git failure. Follow Black's example and return the
Expand Down

0 comments on commit 6379342

Please sign in to comment.