mirror of
https://github.com/django/daphne.git
synced 2025-07-14 18:02:17 +03:00
Changed hardcoded error values to standard errno system symbols in DaphneTestingInstance
This commit is contained in:
parent
2b3d6af8d6
commit
89e2770fde
|
@ -6,6 +6,7 @@ import time
|
|||
import unittest
|
||||
from http.client import HTTPConnection
|
||||
from urllib import parse
|
||||
import errno
|
||||
|
||||
from daphne.test_application import TestApplication
|
||||
|
||||
|
@ -31,7 +32,7 @@ class DaphneTestingInstance:
|
|||
try:
|
||||
s.bind(("127.0.0.1", port))
|
||||
except socket.error as e:
|
||||
if e.errno in [13, 98]:
|
||||
if e.errno in [errno.EACCES, errno.EADDRINUSE]:
|
||||
return True
|
||||
else:
|
||||
raise
|
||||
|
|
Loading…
Reference in New Issue
Block a user