Skip to content

Commit df99532

Browse files
bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548)
The address tuple for CAN_RAW no longer returns the address family after the introduction of CAN ISO-TP support in a30f6d4. However, updating test_socket.CANTest.testSendFrame was missed as part of the change, so the test incorrectly attempts to index past the last tuple item to retrieve the address family. This removes the now-redundant check for equality against socket.AF_CAN, as the tuple will not contain the address family. (cherry picked from commit 355bae8) Co-authored-by: karl ding <[email protected]>
1 parent 8faed45 commit df99532

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/test/test_socket.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class SocketCANTest(unittest.TestCase):
222222
the following commands:
223223
# modprobe vcan
224224
# ip link add dev vcan0 type vcan
225-
# ifconfig vcan0 up
225+
# ip link set up vcan0
226226
"""
227227
interface = 'vcan0'
228228
bufsize = 128
@@ -2048,7 +2048,6 @@ def testSendFrame(self):
20482048
cf, addr = self.s.recvfrom(self.bufsize)
20492049
self.assertEqual(self.cf, cf)
20502050
self.assertEqual(addr[0], self.interface)
2051-
self.assertEqual(addr[1], socket.AF_CAN)
20522051

20532052
def _testSendFrame(self):
20542053
self.cf = self.build_can_frame(0x00, b'\x01\x02\x03\x04\x05')

0 commit comments

Comments
 (0)