[1.5.x] Fixed #19355 -- Improved LiveServerThread's handling of exceptions. Thanks to flub for the report.

Backport of 612357f8ef
This commit is contained in:
Julien Phalip 2012-11-25 12:55:23 +01:00
parent 8c2f36260e
commit 2e5b725197
1 changed files with 1 additions and 0 deletions

View File

@ -1022,6 +1022,7 @@ class LiveServerThread(threading.Thread):
(self.host, port), QuietWSGIRequestHandler)
except WSGIServerException as e:
if (index + 1 < len(self.possible_ports) and
hasattr(e.args[0], 'errno') and
e.args[0].errno == errno.EADDRINUSE):
# This port is already in use, so we go on and try with
# the next one in the list.