Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace typing.re import #2788

Merged
merged 3 commits into from
Jun 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions netmiko/snmp_autodetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down