test: Make exceptions compatible with Python 3

Use "except Type as var" syntax to work with both Python >= 2.6
and Python 3.
This commit is contained in:
Martin Pitt
2014-03-11 17:39:19 +01:00
committed by Denis Kenzior
parent 0c1fcd2b50
commit 0393a41e35
17 changed files with 45 additions and 45 deletions

View File

@@ -33,7 +33,7 @@ for path, properties in modems:
try:
context.SetProperty(sys.argv[2], sys.argv[3])
except dbus.DBusException, e:
except dbus.DBusException as e:
print("Error setting context %s property %s: %s" %\
(path, sys.argv[2], str(e)))
exit(2)