Skip to content

Commit 00b3a39

Browse files
committed
Another fix for getaddrinfo: don't set host to None if it's empty
1 parent f72398a commit 00b3a39

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/test_dns.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ def _test_getaddrinfo(self, *args, **kwargs):
3232
ex.__context__ = err
3333
raise ex
3434
else:
35-
if err is None:
36-
self.assertEqual(a1, a2)
35+
if err is not None:
36+
raise err
37+
38+
self.assertEqual(a1, a2)
3739

3840
def _test_getnameinfo(self, *args, **kwargs):
3941
err = None

uvloop/loop.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,6 @@ cdef class Loop:
509509
if host is not None:
510510
if not isinstance(host, bytes):
511511
raise TypeError('host must be a str or bytes')
512-
if host == b'':
513-
host = None
514512

515513
fut = self._new_future()
516514

0 commit comments

Comments
 (0)