exit if a TimeoutError
occurs
This commit is contained in:
4
bert.py
4
bert.py
@@ -140,7 +140,11 @@ def me(chan, msg):
|
|||||||
|
|
||||||
|
|
||||||
def getData():
|
def getData():
|
||||||
|
try:
|
||||||
raw = irc.recv(4096)
|
raw = irc.recv(4096)
|
||||||
|
except TimeoutError:
|
||||||
|
print("Connection timed out!")
|
||||||
|
sys.exit(0)
|
||||||
if not raw:
|
if not raw:
|
||||||
print("Connection lost!")
|
print("Connection lost!")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
Reference in New Issue
Block a user