1
0
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:
Jon Dufresne
2019-01-28 07:01:35 -08:00
committed by Tim Graham
parent 7444f32527
commit 7785e03ba8
33 changed files with 60 additions and 69 deletions

View File

@@ -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