New submission from Deli.Zhang <gestapo2...@163.com>:

def run(self):
        self.finished.wait(self.interval)
        if not self.finished.isSet():
            self.function(*self.args, **self.kwargs)
        self.finished.set()

I think the function run() should be modified to like this below:

def run(self):
        while not self.finished.isSet():
            self.finished.wait(self.interval)
            self.function(*self.args, **self.kwargs)

In this case, it can still run on next 'interval', and next's next...

----------
components: Library (Lib)
messages: 78540
nosy: gestapo21th
severity: normal
status: open
title: The function, Threading.Timer.run(), may be Inappropriate
type: feature request
versions: Python 3.1

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4781>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to