Fix deprecation warning

This commit is contained in:
Antoine Pitrou 2011-10-11 22:43:37 +02:00
parent 2c5d3cbfb8
commit ffa547e139

View file

@ -1152,8 +1152,8 @@ class BasicCANTest(unittest.TestCase):
def testTooLongInterfaceName(self):
# 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:
self.assertRaisesRegexp(socket.error, 'interface name too long',
s.bind, ('x' * 1024,))
self.assertRaisesRegex(socket.error, 'interface name too long',
s.bind, ('x' * 1024,))
@unittest.skipUnless(hasattr(socket, "CAN_RAW_LOOPBACK"),
'socket.CAN_RAW_LOOPBACK required for this test.')