aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hahn <hahn@univention.de>2010-03-23 16:07:57 +0100
committerJim Meyering <meyering@redhat.com>2010-03-24 10:26:23 +0100
commit1cfbfaa69763da20edfbba5d9bd77b92d08f8af1 (patch)
tree774cdaee36fcdb77f0e515fef684666e97134332 /examples
parentbuild: suppress distracting build output (diff)
downloadlibvirt-1cfbfaa69763da20edfbba5d9bd77b92d08f8af1.tar.gz
libvirt-1cfbfaa69763da20edfbba5d9bd77b92d08f8af1.tar.bz2
libvirt-1cfbfaa69763da20edfbba5d9bd77b92d08f8af1.zip
python example: poll(-0.001) does not sleep forever
The conversion from seconds to milliseconds should only be done for actual delays >= 0, not for the magic -1 value used for infinite timeouts. Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'examples')
-rw-r--r--examples/domain-events/events-python/event-test.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py
index a9ca26bc5..181b38951 100644
--- a/examples/domain-events/events-python/event-test.py
+++ b/examples/domain-events/events-python/event-test.py
@@ -172,10 +172,10 @@ class virEventLoopPure:
if now >= next:
sleep = 0
else:
- sleep = next - now
+ sleep = (next - now) / 1000.0
self.debug("Poll with a sleep of %d" % sleep)
- events = self.poll.poll(sleep / 1000.0)
+ events = self.poll.poll(sleep)
# Dispatch any file handle events that occurred
for (fd, revents) in events: