aboutsummaryrefslogtreecommitdiffstats
path: root/src/bus.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-05-16 18:20:40 +0200
committerMattias Andrée <maandree@operamail.com>2015-05-16 18:20:40 +0200
commitf811313ace319095b2cacdcb0894d137210a14ff (patch)
treead2f0f8882bf16f4ea35b04adb942ce32d57a768 /src/bus.py
parentadd new functions for bus 3.0 (diff)
downloadpython-bus-f811313ace319095b2cacdcb0894d137210a14ff.tar.gz
python-bus-f811313ace319095b2cacdcb0894d137210a14ff.tar.bz2
python-bus-f811313ace319095b2cacdcb0894d137210a14ff.tar.xz
fix poll
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/bus.py')
-rw-r--r--src/bus.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bus.py b/src/bus.py
index ddc0410..31908d0 100644
--- a/src/bus.py
+++ b/src/bus.py
@@ -208,7 +208,7 @@ class Bus:
raise self.__oserror()
- def poll(self) -> str:
+ def poll(self) -> bytes:
'''
Wait for a message to be broadcasted on the bus.
The caller should make a copy of the received message,
@@ -217,11 +217,14 @@ class Bus:
started, the caller of this function should then
either call `Bus.poll` again or `Bus.poll_stop`.
- @return :str The received message
+ @return :bytes The received message
+ NB! The received message will not be decoded from UTF-8
'''
from native_bus import bus_poll_wrapped
- if bus_poll_wrapped(self.bus) == None:
+ message = bus_poll_wrapped(self.bus)
+ if message is None:
raise self.__oserror()
+ return message
def chown(self, owner : int, group : int):