Skip to content

Commit 8a12f46

Browse files
bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548) (#25957)
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 f396864 commit 8a12f46

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
@@ -187,7 +187,7 @@ class SocketCANTest(unittest.TestCase):
187187
the following commands:
188188
# modprobe vcan
189189
# ip link add dev vcan0 type vcan
190-
# ifconfig vcan0 up
190+
# ip link set up vcan0
191191
"""
192192
interface = 'vcan0'
193193
bufsize = 128
@@ -1954,7 +1954,6 @@ def testSendFrame(self):
19541954
cf, addr = self.s.recvfrom(self.bufsize)
19551955
self.assertEqual(self.cf, cf)
19561956
self.assertEqual(addr[0], self.interface)
1957-
self.assertEqual(addr[1], socket.AF_CAN)
19581957

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

0 commit comments

Comments
 (0)