Skip to content
Snippets Groups Projects
Commit bec2712e authored by Philip Withnall's avatar Philip Withnall
Browse files

bluez: Fix naked ‘raise’ statements


When raising an exception, it’s generally a good idea to actually
include the exception value — otherwise Python will re-raise the ‘last
exception which was active in the current scope’, which is not so
useful, especially when you want to print that exception.

Reviewed-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D1296
parent 68ec9eb5
No related branches found
No related tags found
No related merge requests found
......@@ -464,7 +464,7 @@ class PbapDeviceProfileTester(DeviceProfileTester):
path = s[0]
break
if not path:
raise
raise LookupError('Device ‘%s’ not found in services' % device_name)
service = dbus.Interface(bus.get_object("net.connman", path),
"net.connman.Service")
......@@ -517,7 +517,7 @@ class PbapDeviceProfileTester(DeviceProfileTester):
if ret == 'y' or ret == 'Y':
TEST_PASSED("A2DP Source")
else:
raise
raise RuntimeError('Invalid response: ' + ret)
except Exception as error:
TEST_FAILED("A2DP Source: " + str(error))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment