diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-11-03 06:07:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-11-03 06:07:48 +0000 |
commit | 85812cd25d9e2f015bb71b26d51458b3718bf6c7 (patch) | |
tree | 463ad57ffbe3636e06e9bb36104fbf12938e78c1 /gitlint/display.py | |
parent | Releasing debian version 0.13.1-6. (diff) | |
download | gitlint-85812cd25d9e2f015bb71b26d51458b3718bf6c7.tar.xz gitlint-85812cd25d9e2f015bb71b26d51458b3718bf6c7.zip |
Merging upstream version 0.14.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gitlint/display.py')
-rw-r--r-- | gitlint/display.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gitlint/display.py b/gitlint/display.py index dd17ac0..c66a256 100644 --- a/gitlint/display.py +++ b/gitlint/display.py @@ -1,12 +1,13 @@ import codecs import locale -from sys import stdout, stderr, version_info +from sys import stdout, stderr +from gitlint.utils import IS_PY2 # For some reason, python 2.x sometimes messes up with printing unicode chars to stdout/stderr # This is mostly when there is a mismatch between the terminal encoding and the python encoding. # This use-case is primarily triggered when piping input between commands, in particular our integration tests # tend to trip over this. -if version_info[0] == 2: +if IS_PY2: stdout = codecs.getwriter(locale.getpreferredencoding())(stdout) # pylint: disable=invalid-name stderr = codecs.getwriter(locale.getpreferredencoding())(stderr) # pylint: disable=invalid-name |