Skip to content

WebAgg: flush stdout after printing, redirect "stopped" message to stder... [backport to 1.4.x] #3762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/matplotlib/backends/backend_webagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import json
import os
import random
import sys
import socket
import threading

Expand Down Expand Up @@ -333,11 +334,13 @@ def start(cls):
launched. We may end up with two concurrently running loops in that
unlucky case with all the expected consequences.
"""
print("Press Ctrl+C to stop server")
print("Press Ctrl+C to stop WebAgg server")
sys.stdout.flush()
try:
tornado.ioloop.IOLoop.instance().start()
except KeyboardInterrupt:
print("Server stopped")
print("Server is stopped")
sys.stdout.flush()
finally:
cls.started = False

Expand Down