mirror of
https://github.com/sivel/speedtest-cli.git
synced 2026-10-22 10:36:26 +02:00
Always flush in py2 print_
This commit is contained in:
+2
-1
@@ -191,7 +191,7 @@ else:
|
|||||||
|
|
||||||
Taken from https://pypi.python.org/pypi/six/
|
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)
|
fp = kwargs.pop("file", sys.stdout)
|
||||||
if fp is None:
|
if fp is None:
|
||||||
@@ -210,6 +210,7 @@ else:
|
|||||||
errors = "strict"
|
errors = "strict"
|
||||||
data = data.encode(encoding, errors)
|
data = data.encode(encoding, errors)
|
||||||
fp.write(data)
|
fp.write(data)
|
||||||
|
fp.flush()
|
||||||
want_unicode = False
|
want_unicode = False
|
||||||
sep = kwargs.pop("sep", None)
|
sep = kwargs.pop("sep", None)
|
||||||
if sep is not None:
|
if sep is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user