diff options
author | Rob Austein <sra@hactrn.net> | 2010-05-31 01:18:57 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2010-05-31 01:18:57 +0000 |
commit | 1f95c1ecd843f99257774a51d355477b3a819065 (patch) | |
tree | 7fd77c6c04b115500ec8aab85ca159be5334107c /rpkid/rpki/async.py | |
parent | 015eba197a4553aa82b5766254235904adfad587 (diff) |
Preliminary fix to timer.cancel(). Right fix may be to change
__cmp__() method and use an explicit sort key, but this works.
svn path=/rpkid/rpki/async.py; revision=3267
Diffstat (limited to 'rpkid/rpki/async.py')
-rw-r--r-- | rpkid/rpki/async.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/rpkid/rpki/async.py b/rpkid/rpki/async.py index fc6ba663..faf8e991 100644 --- a/rpkid/rpki/async.py +++ b/rpkid/rpki/async.py @@ -152,10 +152,9 @@ class timer(object): """ if self.gc_debug: self.trace("Canceling %r" % self) - try: - self.queue.remove(self) - except ValueError: - pass + for i in xrange(len(self.queue) - 1, -1, -1): + if self.queue[i] is self: + del self.queue[i] def is_set(self): """Test whether this timer is currently set.""" |