diff --git a/pyroute2/dhcp/client.py b/pyroute2/dhcp/client.py index f3123e3a2..911f506e1 100644 --- a/pyroute2/dhcp/client.py +++ b/pyroute2/dhcp/client.py @@ -151,8 +151,8 @@ async def wait_for_state( '''Waits until the client is in the target state.''' try: await asyncio.wait_for(self._states[state].wait(), timeout=timeout) - except TimeoutError as err: - raise TimeoutError( + except asyncio.exceptions.TimeoutError as err: + raise asyncio.exceptions.TimeoutError( f'Timed out waiting for the {state.name} state. ' f'Current state: {self.state.name}' ) from err diff --git a/tests/test_linux/test_dhcp/test_integration.py b/tests/test_linux/test_dhcp/test_integration.py index 05cacffa3..1b992b71a 100644 --- a/tests/test_linux/test_dhcp/test_integration.py +++ b/tests/test_linux/test_dhcp/test_integration.py @@ -1,6 +1,6 @@ import json -from ipaddress import IPv4Address import os +from ipaddress import IPv4Address from pathlib import Path import pytest