better fix for log.py mishandling certain strings
This commit is contained in:
parent
55e0851eb8
commit
5f1ac6254e
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
try:
|
||||
func(*input)
|
||||
except Exception:
|
||||
traceback.print_exc(Exception)
|
||||
|
||||
thread.start_new_thread(trampoline, (func,))
|
||||
|
||||
|
|
Loading…
Reference in New Issue