We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bc72da commit f42c2a6Copy full SHA for f42c2a6
tests/snippets/stdlib_socket.py
@@ -24,14 +24,15 @@
24
assert recv_b == MESSAGE_B
25
26
# fileno
27
-connector_fd = connector.fileno()
28
-connection_fd = connection.fileno()
29
-os.write(connector_fd, MESSAGE_A)
30
-connection.send(MESSAGE_B)
31
-recv_a = connection.recv(len(MESSAGE_A))
32
-recv_b = os.read(connector_fd, (len(MESSAGE_B)))
33
-assert recv_a == MESSAGE_A
34
-assert recv_b == MESSAGE_B
+if os.name == "posix":
+ connector_fd = connector.fileno()
+ connection_fd = connection.fileno()
+ os.write(connector_fd, MESSAGE_A)
+ connection.send(MESSAGE_B)
+ recv_a = connection.recv(len(MESSAGE_A))
+ recv_b = os.read(connector_fd, (len(MESSAGE_B)))
+ assert recv_a == MESSAGE_A
35
+ assert recv_b == MESSAGE_B
36
37
connection.close()
38
connector.close()
0 commit comments