mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
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 ina30f6d45ac
. 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 commit355bae8882
) Co-authored-by: karl ding <karlding@users.noreply.github.com>
This commit is contained in:
parent
8faed45242
commit
df99532a05
1 changed files with 1 additions and 2 deletions
|
@ -222,7 +222,7 @@ class SocketCANTest(unittest.TestCase):
|
|||
the following commands:
|
||||
# modprobe vcan
|
||||
# ip link add dev vcan0 type vcan
|
||||
# ifconfig vcan0 up
|
||||
# ip link set up vcan0
|
||||
"""
|
||||
interface = 'vcan0'
|
||||
bufsize = 128
|
||||
|
@ -2048,7 +2048,6 @@ class CANTest(ThreadedCANSocketTest):
|
|||
cf, addr = self.s.recvfrom(self.bufsize)
|
||||
self.assertEqual(self.cf, cf)
|
||||
self.assertEqual(addr[0], self.interface)
|
||||
self.assertEqual(addr[1], socket.AF_CAN)
|
||||
|
||||
def _testSendFrame(self):
|
||||
self.cf = self.build_can_frame(0x00, b'\x01\x02\x03\x04\x05')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue