summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2017-06-02 09:56:45 -0500
committerMatt Martz <matt@sivel.net>2017-11-23 10:15:09 -0600
commitd9642b2047913152fe4d5c3bee6f20216cd7f813 (patch)
tree9135f001912230f52776067fd2eee7a028fefc25
parentf3a607feb20ed534de07f79262e98e937b9d24bc (diff)
Always flush in py2 print_
-rwxr-xr-xspeedtest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/speedtest.py b/speedtest.py
index d467902..6ea6103 100755
--- a/speedtest.py
+++ b/speedtest.py
@@ -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: