diff --git a/netmiko/snmp_autodetect.py b/netmiko/snmp_autodetect.py index e21381eca..f514a435c 100644 --- a/netmiko/snmp_autodetect.py +++ b/netmiko/snmp_autodetect.py @@ -20,8 +20,7 @@ Note, pysnmp is a required dependency for SNMPDetect and is intentionally not included in netmiko requirements. So installation of pysnmp might be required. """ -from typing import Optional, Dict -from typing.re import Pattern +from typing import Optional, Dict, Pattern import re try: @@ -334,7 +333,7 @@ def autodetect(self) -> Optional[str]: for entry in snmp_mapper_list: for device_type, v in entry.items(): oid: str = v["oid"] # type: ignore - regex: Pattern = v["expr"] + regex: Pattern[str] = v["expr"] # type: ignore # Used cache data if we already queryied this OID if self._response_cache.get(oid):