Commits

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

Comments (0)

Files changed (1)

File cherrypy/wsgiserver/__init__.py

     # 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