From 5f208e04c159791e668031a7fa83f98724ec8d24 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 3 Nov 2020 07:07:45 +0100 Subject: Adding upstream version 0.14.0. Signed-off-by: Daniel Baumann --- gitlint/display.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gitlint/display.py') 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 -- cgit v1.2.3