2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-10-20 06:35:33 +00:00

Workaround some bad pysnmp assumptions about importing importlib

This commit is contained in:
Jarrod Johnson
2026-10-14 09:04:43 -04:00
parent 059f4811fe
commit 7460f66e23
+7
View File
@@ -25,6 +25,13 @@ import asyncio
import confluent.exceptions as exc
import inspect
import socket
try:
# Some pysnmp installs expect util to be an attribute of importlib, but that doesn't naturally happen reliably
# So we prime the pump by importing it the proper way, then pysnmp can succesfully do it the wrong way
import importlib.util # noqa: F401
except ImportError:
importlib = None
import pysnmp.hlapi.asyncio as snmp
async def _get_transport(name):