Ticket #14273: 14273.dev-server-shutdown.diff

File 14273.dev-server-shutdown.diff, 684 bytes (added by Julien Phalip, 13 years ago)
  • django/core/servers/basehttp.py

    diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py
    index 4e179dc..80cba75 100644
    a b def run(addr, port, wsgi_handler, ipv6=False):  
    693693    server_address = (addr, port)
    694694    httpd = WSGIServer(server_address, WSGIRequestHandler, ipv6=ipv6)
    695695    httpd.set_app(wsgi_handler)
    696     httpd.serve_forever()
     696    try:
     697        httpd.serve_forever()
     698    except (KeyboardInterrupt, SystemExit):
     699        # Ensure that the server shuts down cleanly under OpenBSD when the
     700        # process is killed or the user has pressed CTRL-C.
     701        pass
     702    except:
     703        raise
Back to Top