Protect 3p lib imports + update requirements

This commit is contained in:
DevilXD committed 2022-01-11 20:29:13 +01:00
1 parent 716a824323
commit 1aba5984d2
3 files changed
+12 -5

No files matched your search

+8 -2
View File
@@ -13,8 +13,14 @@ from typing import (
Any, Optional, List, Dict, Set, Tuple, TypedDict, Iterable, NoReturn, TYPE_CHECKING Any, Optional, List, Dict, Set, Tuple, TypedDict, Iterable, NoReturn, TYPE_CHECKING
) )
from PIL import Image try:
import pystray from PIL import Image
except ModuleNotFoundError as exc:
raise ImportError("You have to run 'pip install Pillow' first") from exc
try:
import pystray
except ModuleNotFoundError as exc:
raise ImportError("You have to run 'pip install pystray' first") from exc
from version import __version__ from version import __version__
from constants import FORMATTER, WS_TOPICS_LIMIT, MAX_WEBSOCKETS, State from constants import FORMATTER, WS_TOPICS_LIMIT, MAX_WEBSOCKETS, State
+2 -1
View File
@@ -1,2 +1,3 @@
aiohttp>2.0,<4.0 aiohttp>2.0,<4.0
pywin32 Pillow
pystray
+2 -2
View File
@@ -14,8 +14,8 @@ from typing import (
try: try:
import aiohttp import aiohttp
except ImportError: except ModuleNotFoundError as exc:
raise ImportError("You have to run 'python -m pip install aiohttp' first") raise ImportError("You have to run 'pip install aiohttp' first") from exc
from channel import Channel from channel import Channel
from gui import GUIManager, LoginData from gui import GUIManager, LoginData