Skip to content

Commit 1a8925c

Browse files
committed
Fix test_pseudosocket on Linux
1 parent 318e593 commit 1a8925c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_sockets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,11 @@ def test_pseudo(real_sock, pseudo_sock, *, is_dup=False):
239239
self.assertIn('AF_UNIX', repr(pseudo_sock))
240240

241241
self.assertEqual(pseudo_sock.family, real_sock.family)
242-
self.assertEqual(pseudo_sock.type, real_sock.type)
243242
self.assertEqual(pseudo_sock.proto, real_sock.proto)
244243

244+
# Guard against SOCK_NONBLOCK bit in socket.type on Linux.
245+
self.assertEqual(pseudo_sock.type & 0xf, real_sock.type & 0xf)
246+
245247
with self.assertRaises(TypeError):
246248
pickle.dumps(pseudo_sock)
247249

0 commit comments

Comments
 (0)