Skip to content

Commit 4d45624

Browse files
committed
Fix test in logging
1 parent 7ce46a7 commit 4d45624

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Lib/http/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ class HTTPServer(socketserver.TCPServer):
118118
allow_reuse_port = False
119119

120120
def __init__(self, *args, **kwargs):
121-
if sys.platform == 'win32' and self.address_family == socket.AF_UNIX:
121+
if sys.platform == 'win32' and hasattr(socket, 'AF_UNIX') and\
122+
self.address_family == socket.AF_UNIX:
123+
# reuse address with AF_UNIX is not supported on Windows
122124
self.allow_reuse_address = False
123125

124126
super().__init__(*args, **kwargs)

Lib/test/test_logging.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,6 +2089,8 @@ def test_output(self):
20892089
self.assertEqual(self.log_output, b'<11>h\xc3\xa4m-sp\xc3\xa4m')
20902090

20912091
def test_udp_reconnection(self):
2092+
if self.server_exception:
2093+
self.skipTest(self.server_exception)
20922094
logger = logging.getLogger("slh")
20932095
self.sl_hdlr.close()
20942096
self.handled.clear()

0 commit comments

Comments
 (0)