diff --git a/tqdm/std.py b/tqdm/std.py index 08cd00d3..fb4aa6ad 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -336,7 +336,9 @@ class tqdm(Comparable): """ fp = file fp_flush = getattr(fp, 'flush', lambda: None) # pragma: no cover - fp_flush() + if fp in (sys.stderr, sys.stdout): + sys.stderr.flush() + sys.stdout.flush() def fp_write(s): fp.write(_unicode(s))