def do_cleanPending(cls):
# don't import reactor when module is loaded
from twisted.internet import reactor
# flush short-range timers
reactor.iterate(0)
reactor.iterate(0)
pending = reactor.getDelayedCalls()
if pending:
s = PENDING_TIMED_CALLS_MSG
for p in pending:
s += " %s\n" % (p,)
if p.active():
p.cancel() # delete the rest
else:
print "WEIRNESS! pending timed call not active+!"
raise PendingTimedCallsError(s)
评论列表
文章目录