summaryrefslogtreecommitdiffstats
path: root/test/test-call-forwarding
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2014-03-11 17:39:19 +0100
committerDenis Kenzior <denkenz@gmail.com>2014-03-11 19:32:46 -0500
commit0393a41e3589380b701dc73fc15fa90a24d7e55a (patch)
treec8d5fae96cf6bc24271937cffd8489c298758431 /test/test-call-forwarding
parent0c1fcd2b50908bda607fce70c796033e33832b11 (diff)
downloadofono-0393a41e3589380b701dc73fc15fa90a24d7e55a.tar.bz2
test: Make exceptions compatible with Python 3
Use "except Type as var" syntax to work with both Python >= 2.6 and Python 3.
Diffstat (limited to 'test/test-call-forwarding')
-rwxr-xr-xtest/test-call-forwarding26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/test-call-forwarding b/test/test-call-forwarding
index 772948b5..a7ec1e4b 100755
--- a/test/test-call-forwarding
+++ b/test/test-call-forwarding
@@ -36,47 +36,47 @@ if __name__ == "__main__":
try:
cf.SetProperty("FoobarNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set timeout - Good")
try:
cf.SetProperty("VoiceNotReachableTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set timeout - Good")
try:
cf.SetProperty("VoiceNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set timeout - Good")
try:
cf.SetProperty("DataNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set timeout - Good")
try:
cf.SetProperty("FaxNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set timeout - Good")
try:
cf.SetProperty("SmsNoReplyTimeout", dbus.UInt16(19))
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set timeout - Good")
try:
cf.SetProperty("VoiceNoReply", "")
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to erase voice no reply rule - Bad")
try:
cf.SetProperty("VoiceNoReply", "+134444")
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to register voice no reply rule - Bad")
try:
cf.SetProperty("VoiceNoReplyTimeout", dbus.UInt16(30))
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set voice no reply timeout - Bad")
properties = cf.GetProperties()
@@ -86,7 +86,7 @@ if __name__ == "__main__":
try:
cf.SetProperty("VoiceUnconditional", "+155555")
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to set Voice Unconditional - Bad")
properties = cf.GetProperties()
@@ -95,12 +95,12 @@ if __name__ == "__main__":
try:
cf.DisableAll("foobar")
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to delete invalids - Good")
try:
cf.DisableAll("conditional")
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to delete all conditional - Bad")
properties = cf.GetProperties()
@@ -110,7 +110,7 @@ if __name__ == "__main__":
try:
cf.DisableAll("all")
- except dbus.DBusException, e:
+ except dbus.DBusException as e:
print("Unable to delete all conditional - Bad")
print(properties["VoiceUnconditional"])