Ticket #14273: patch-django_core_servers_basehttp_py

File patch-django_core_servers_basehttp_py, 718 bytes (added by rmboggs, 14 years ago)
Line 
1--- django/core/servers/basehttp.py.orig Fri Dec 24 13:26:15 2010
2+++ django/core/servers/basehttp.py Fri Dec 24 13:26:15 2010
3@@ -14,6 +14,7 @@ import re
4 import stat
5 import sys
6 import urllib
7+import select
8
9 from django.core.management.color import color_style
10 from django.utils.http import http_date
11@@ -718,4 +719,11 @@ def run(addr, port, wsgi_handler):
12 server_address = (addr, port)
13 httpd = WSGIServer(server_address, WSGIRequestHandler)
14 httpd.set_app(wsgi_handler)
15- httpd.serve_forever()
16+
17+ try:
18+ httpd.serve_forever()
19+ except select.error as (errno, msg):
20+ # catch Interrupted system call exceptions
21+ # (CTRL-C)
22+ if errno != 4:
23+ raise
Back to Top