aboutsummaryrefslogtreecommitdiffstats
path: root/src/bus.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-23 05:06:08 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-23 05:06:08 +0200
commit69b62ab9e9fbb57f47f9f0bb3cbaab1b6d0f3087 (patch)
treeaec14cec2dcb02354878ab3809d279a140248b8b /src/bus.py
parentfix some errors (diff)
downloadpython-bus-1.0.tar.gz
python-bus-1.0.tar.bz2
python-bus-1.0.tar.xz
suppress error on exit and fix callback1.0
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/bus.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bus.py b/src/bus.py
index 5502500..91ea5da 100644
--- a/src/bus.py
+++ b/src/bus.py
@@ -120,7 +120,10 @@ class Bus:
'''
Close the bus
'''
- from native_bus import bus_close_wrapped, bus_deallocate
+ try:
+ from native_bus import bus_close_wrapped, bus_deallocate
+ except:
+ return
if self.bus is not None:
if bus_close_wrapped(self.bus) == -1:
raise self.__oserror()
@@ -153,6 +156,7 @@ class Bus:
0: stop listening
1: continue listening
-1: an error has occurred
+ NB! The received message will not be decoded from UTF-8
@param user_data See description of `callback`
'''
from native_bus import bus_read_wrapped