Sfoglia il codice sorgente

Add exception handling

master
Thomas Mannay GitHub 7 anni fa
parent
commit
6b89457021
1 ha cambiato i file con 9 aggiunte e 2 eliminazioni
  1. +9
    -2
      seddy.py

+ 9
- 2
seddy.py Vedi File

@@ -67,9 +67,16 @@ def seddy(sed, history):
if msg == False:
return False
if "g" in regex[3]:
return re.sub(regex[1], regex[2], msg, flags=flag)
try:
res = re.sub(regex[1], regex[2], msg, flags=f)
except:
res = False
else:
return re.sub(regex[1], regex[2], msg, 1, flag)
try:
res = re.sub(regex[1], regex[2], msg, 1, f)
except:
res = False
return res

def notice(msg):
send.write('NOTICE ' + channel + ' :' + msg + '\r\n')


Loading…
Annulla
Salva