diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-21 03:30:38 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-21 03:30:38 +0000 |
| commit | 7cc2bf2f030940f0acd7b6ad0c56f2d60122fb34 (patch) | |
| tree | 6627b8c7a9273918f7f501bcf39aae06db845f41 /django | |
| parent | 910bbe8f1fab2d8c9be22d056ec811d2a1085a91 (diff) | |
Fixed #4304 -- Modified sys.exit to os._exit to make sure development server quits when an error occurs attempting to bind to the requested port (e.g., if another server is already running). Thanks, Mario Gonzalez <gonzalemario@gmail.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5738 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/management.py b/django/core/management.py index 06a9a6857c..4c68417517 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -1236,7 +1236,8 @@ def runserver(addr, port, use_reloader=True, admin_media_dir=''): except (AttributeError, KeyError): error_text = str(e) sys.stderr.write(style.ERROR("Error: %s" % error_text) + '\n') - sys.exit(1) + # Need to use an OS exit because sys.exit doesn't work in a thread + os._exit(1) except KeyboardInterrupt: sys.exit(0) if use_reloader: |
