fix str-concat during in except blocks

This commit is contained in:
jkhsjdhjs 2024-01-30 22:58:08 +00:00
parent 1b252ca2c7
commit f449305ccd

16
bert.py
View File

@ -75,7 +75,7 @@ def connect(host, port):
try: try:
irc.connect((host, port)) irc.connect((host, port))
except Exception as err: except Exception as err:
print("Connection failed! "+err) print("Connection failed! "+str(err))
def sendRaw(data): def sendRaw(data):
@ -87,7 +87,7 @@ def register(nick, host):
try: try:
sendRaw("USER "+nick+" "+host+" "+nick+" "+nick+"\n") sendRaw("USER "+nick+" "+host+" "+nick+" "+nick+"\n")
except Exception as err: except Exception as err:
print("Failed! "+err) print("Failed! "+str(err))
def name(nick): def name(nick):
@ -95,7 +95,7 @@ def name(nick):
try: try:
sendRaw("NICK "+nick+"\n") sendRaw("NICK "+nick+"\n")
except Exception as err: except Exception as err:
print("Failed! "+err) print("Failed! "+str(err))
def auth(nick, password): def auth(nick, password):
@ -111,7 +111,7 @@ def join(chan):
try: try:
sendRaw("JOIN "+chan+"\n") sendRaw("JOIN "+chan+"\n")
except Exception as err: except Exception as err:
print("Failed! "+err) print("Failed! "+str(err))
def mode(nick): def mode(nick):
@ -119,7 +119,7 @@ def mode(nick):
try: try:
sendRaw("MODE "+nick+" +B-x\n") sendRaw("MODE "+nick+" +B-x\n")
except Exception as err: except Exception as err:
print("Failed! "+err) print("Failed! "+str(err))
def part(chan): def part(chan):
@ -135,7 +135,7 @@ def say(chan, msg):
sendRaw("PRIVMSG "+chan+" :"+msg+"\n") sendRaw("PRIVMSG "+chan+" :"+msg+"\n")
print("OK") print("OK")
except Exception as err: except Exception as err:
print("Error: "+err) print("Error: "+str(err))
def raw(msg): def raw(msg):
@ -150,7 +150,7 @@ def me(chan, msg):
try: try:
sendRaw("PRIVMSG "+chan+" :\u0001ACTION "+msg+"\u0001\n") sendRaw("PRIVMSG "+chan+" :\u0001ACTION "+msg+"\u0001\n")
except Exception as err: except Exception as err:
print("Error: "+err) print("Error: "+str(err))
def getData(): def getData():
@ -269,7 +269,7 @@ def start(host, port, nick, password, chans):
join(chan) join(chan)
sleep(2) sleep(2)
except Exception as err: except Exception as err:
print("FAIL: "+err) print("FAIL: "+str(err))
def command_loop(): def command_loop():