8000 WebAgg: flush stdout after printing · matplotlib/matplotlib@7f14470 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f14470

Browse files
committed
WebAgg: flush stdout after printing
Without flushing, the message can be displayed too late
1 parent 28d3fcd commit 7f14470

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/backends/backend_webagg.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import json
2222
import os
2323
import random
24+
import sys
2425
import socket
2526
import threading
2627

@@ -333,11 +334,13 @@ def start(cls):
333334
launched. We may end up with two concurrently running loops in that
334335
unlucky case with all the expected consequences.
335336
"""
336-
print("Press Ctrl+C to stop server")
337+
print("Press Ctrl+C to stop WebAgg server")
338+
sys.stdout.flush()
337339
try:
338340
tornado.ioloop.IOLoop.instance().start()
339341
except KeyboardInterrupt:
340-
print("Server stopped")
342+
print("Server is stopped")
343+
sys.stdout.flush()
341344
finally:
342345
cls.started = False
343346

0 commit comments

Comments
 (0)
0