Skip to content

Commit 52c482f

Browse files
committed
Use a better error message
1 parent 7f13eef commit 52c482f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • pyrogram/connection/transport/tcp

pyrogram/connection/transport/tcp/tcp.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@
1818

1919
import logging
2020
import socket
21+
import sys
2122
from collections import namedtuple
2223

23-
import socks
24+
try:
25+
import socks
26+
except ImportError:
27+
sys.exit(
28+
"PySocks is missing and Pyrogram can't run without. "
29+
"Please install it using \"pip3 install pysocks\"."
30+
)
2431

2532
log = logging.getLogger(__name__)
2633

0 commit comments

Comments
 (0)