1 parent ae21ada commit 42a2878Copy full SHA for 42a2878
2 files changed
pyrogram/connection/transport/tcp/tcp.py
@@ -18,17 +18,18 @@
18
19
import logging
20
import socket
21
-import sys
22
from collections import namedtuple
23
24
try:
25
import socks
26
-except ImportError:
27
- sys.exit(
+except ImportError as e:
+ e.msg = (
28
"PySocks is missing and Pyrogram can't run without. "
29
"Please install it using \"pip3 install pysocks\"."
30
)
31
+ raise e
32
+
33
log = logging.getLogger(__name__)
34
35
Proxy = namedtuple("Proxy", ["enabled", "hostname", "port", "username", "password"])
pyrogram/crypto/aes.py
@@ -16,19 +16,18 @@
16
# You should have received a copy of the GNU Lesser General Public License
17
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
-
import tgcrypto
"TgCrypto is missing and Pyrogram can't run without. "
"Please install it using \"pip3 install tgcrypto\". "
"More info: https://docs.pyrogram.ml/resources/TgCrypto"
-# TODO: Ugly IFs
class AES:
@classmethod
def ige_encrypt(cls, data: bytes, key: bytes, iv: bytes) -> bytes:
0 commit comments