Skip to content

Commit

Permalink
made changes to keep the synchronous part usability regardless of dep…
Browse files Browse the repository at this point in the history
…endencies
  • Loading branch information
aiantsen committed Apr 10, 2024
1 parent 2d9738c commit 9fa0a3b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions zabbix_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@
# OTHER DEALINGS IN THE SOFTWARE.

from .api import ZabbixAPI
from .aioapi import AsyncZabbixAPI
from .sender import Sender
from .aiosender import AsyncSender
from .getter import Getter
from .aiogetter import AsyncGetter
from .types import ItemValue, APIVersion
from .exceptions import ModuleBaseException, APIRequestError, APINotSupported, ProcessingError

from .aiosender import AsyncSender
from .aiogetter import AsyncGetter
try:
__import__('aiohttp')
except ModuleNotFoundError:
class AsyncZabbixAPI():
def __init__(self):
raise ModuleNotFoundError("No module named 'aiohttp'")
else:
from .aioapi import AsyncZabbixAPI

__all__ = (
'ZabbixAPI',
'AsyncZabbixAPI',
Expand Down

0 comments on commit 9fa0a3b

Please sign in to comment.