Skip to content

Commit 57fcef2

Browse files
committed
Merge pull request #3762 from vmarkovtsev/patch-1
MNT : WebAgg: flush stdout after printing, redirect "stopped" message to stder
2 parents ef9fc19 + 7f14470 commit 57fcef2

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)