Commit ffa547e1 authored by Antoine Pitrou's avatar Antoine Pitrou

Fix deprecation warning

parent 2c5d3cbf
...@@ -1152,8 +1152,8 @@ class BasicCANTest(unittest.TestCase): ...@@ -1152,8 +1152,8 @@ class BasicCANTest(unittest.TestCase):
def testTooLongInterfaceName(self): def testTooLongInterfaceName(self):
# most systems limit IFNAMSIZ to 16, take 1024 to be sure # most systems limit IFNAMSIZ to 16, take 1024 to be sure
with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s: with socket.socket(socket.PF_CAN, socket.SOCK_RAW, socket.CAN_RAW) as s:
self.assertRaisesRegexp(socket.error, 'interface name too long', self.assertRaisesRegex(socket.error, 'interface name too long',
s.bind, ('x' * 1024,)) s.bind, ('x' * 1024,))
@unittest.skipUnless(hasattr(socket, "CAN_RAW_LOOPBACK"), @unittest.skipUnless(hasattr(socket, "CAN_RAW_LOOPBACK"),
'socket.CAN_RAW_LOOPBACK required for this test.') 'socket.CAN_RAW_LOOPBACK required for this test.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment