better fix for log.py mishandling certain strings

This commit is contained in:
Ryan Hitchman 2009-11-18 19:45:57 -07:00
parent 55e0851eb8
commit 5f1ac6254e
2 changed files with 7 additions and 7 deletions

View File

@ -101,11 +101,8 @@ def log(bot, input):
if beau == '': # don't log this
return
try:
print '%s %s %s' % (timestamp, input.chan, beau)
except Exception, e:
print e, timestamp, input.chan, beau
if input.chan:
fd = get_log_fd(bot.persist_dir, input.server, input.chan)
fd.write(timestamp + ' ' + beau + '\n')
print u'%s %s %s' % (timestamp, input.chan, beau)

View File

@ -1,6 +1,6 @@
import Queue
import thread
import traceback
def _isfunc(x):
if type(x) == type(_isfunc):
@ -84,7 +84,10 @@ def tee(func, **kwargs):
input = func._iqueue.get()
if input == StopIteration:
return
func(*input)
try:
func(*input)
except Exception:
traceback.print_exc(Exception)
thread.start_new_thread(trampoline, (func,))