1. Iyed B.
  2. CherryPy


Sylvain Hellegouarch  committed ec4e509

Added extended the base example to demonstrate how to stop the server (and avoid nervous breakdown with Ctrl-C)

  • Participants
  • Parent commits 104bbe4
  • Branches default

Comments (0)

Files changed (1)

File cherrypy/wsgiserver/__init__.py

View file
  • Ignore whitespace
     # server.ssl_private_key = <filename>
     if __name__ == '__main__':
-        server.start()
+        try:
+            server.start()
+        except KeyboardInterrupt:
+            server.stop()
 This won't call the CherryPy engine (application side) at all, only the
 WSGI server, which is independant from the rest of CherryPy. Don't