mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
This commit is contained in:
@@ -194,10 +194,10 @@ class LiveServerPort(LiveServerBase):
|
||||
TestCase = type("TestCase", (LiveServerBase,), {})
|
||||
try:
|
||||
TestCase.setUpClass()
|
||||
except socket.error as e:
|
||||
except OSError as e:
|
||||
if e.errno == errno.EADDRINUSE:
|
||||
# We're out of ports, LiveServerTestCase correctly fails with
|
||||
# a socket error.
|
||||
# an OSError.
|
||||
return
|
||||
# Unexpected error.
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user