Skip to content

Commit 355bae8

Browse files
authored
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.
1 parent 0949029 commit 355bae8

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
@@ -224,7 +224,7 @@ class SocketCANTest(unittest.TestCase):
224224
the following commands:
225225
# modprobe vcan
226226
# ip link add dev vcan0 type vcan
227-
# ifconfig vcan0 up
227+
# ip link set up vcan0
228228
"""
229229
interface = 'vcan0'
230230
bufsize = 128
@@ -2085,7 +2085,6 @@ def testSendFrame(self):
20852085
cf, addr = self.s.recvfrom(self.bufsize)
20862086
self.assertEqual(self.cf, cf)
20872087
self.assertEqual(addr[0], self.interface)
2088-
self.assertEqual(addr[1], socket.AF_CAN)
20892088

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

0 commit comments

Comments
 (0)