Always flush in py2 print_

This commit is contained in:
Matt Martz 2017-06-02 09:56:45 -05:00
parent f3a607feb2
commit d9642b2047
1 changed files with 2 additions and 1 deletions

View File

@ -191,7 +191,7 @@ else:
Taken from https://pypi.python.org/pypi/six/
Modified to set encoding to UTF-8 always
Modified to set encoding to UTF-8 always, and to flush after write
"""
fp = kwargs.pop("file", sys.stdout)
if fp is None:
@ -210,6 +210,7 @@ else:
errors = "strict"
data = data.encode(encoding, errors)
fp.write(data)
fp.flush()
want_unicode = False
sep = kwargs.pop("sep", None)
if sep is not None: