Index: base.py =================================================================== --- base.py (revision 10658) +++ base.py (working copy) @@ -368,7 +368,11 @@ assert callable(_f), "%s is not callable" % _f assert sys.maxint >= _seconds >= 0, \ "%s is not greater than or equal to 0 seconds" % (_seconds,) - tple = DelayedCall(seconds() + _seconds, _f, args, kw, + if _seconds == 0: + tcc = 0 + else: + tcc = seconds() + _seconds + tple = DelayedCall(tcc, _f, args, kw, self._pendingTimedCalls.remove, self._resetCallLater) insort(self._pendingTimedCalls, tple) @@ -416,8 +420,11 @@ count += 1 del self.threadCallQueue[:count] now = seconds() - while self._pendingTimedCalls and (self._pendingTimedCalls[-1].time <= now): - call = self._pendingTimedCalls.pop() + do=[] + while self._pendingTimedCalls and (self._pendingTimedCalls[-1].time <= now): + do.append(self._pendingTimedCalls.pop()) + for call in do: try: call.called = 1 call.func(*call.args, **call.kw)