summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2013-12-03 15:47:33 +0000
committerDaniel P. Berrange <berrange@redhat.com>2013-12-11 16:12:54 +0000
commitb882ae9ecf0cb4c5e1d6a429a9581106bfbcefd4 (patch)
tree39868bbb2f919a2cac60517fd2e48629b52ed35a /examples
parent3f4e32c6a1c994cec9d24767703da40e4c28bead (diff)
downloadlibvirt-python-b882ae9ecf0cb4c5e1d6a429a9581106bfbcefd4.tar.gz
examples: Ensure we write bytes to the self-pipe
Strings in python3 default to unicode, so when writing to the self-pipe we must be sure to use bytes by calling the encode() method. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/event-test.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/event-test.py b/examples/event-test.py
index cf1a8b8..1402c04 100644
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -236,7 +236,7 @@ class virEventLoopPure:
def interrupt(self):
if self.runningPoll and not self.pendingWakeup:
self.pendingWakeup = True
- os.write(self.pipetrick[1], 'c')
+ os.write(self.pipetrick[1], 'c'.encode("UTF-8"))
# Registers a new file handle 'fd', monitoring for 'events' (libvirt