aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
Diffstat (limited to 'wpa_supplicant')
-rwxr-xr-xwpa_supplicant/examples/dpp-qrcode.py4
-rwxr-xr-xwpa_supplicant/examples/p2p-nfc.py28
-rw-r--r--wpa_supplicant/examples/p2p/p2p_connect.py4
-rw-r--r--wpa_supplicant/examples/p2p/p2p_disconnect.py2
-rw-r--r--wpa_supplicant/examples/p2p/p2p_find.py2
-rw-r--r--wpa_supplicant/examples/p2p/p2p_flush.py2
-rw-r--r--wpa_supplicant/examples/p2p/p2p_group_add.py2
-rw-r--r--wpa_supplicant/examples/p2p/p2p_invite.py2
-rw-r--r--wpa_supplicant/examples/p2p/p2p_listen.py2
-rw-r--r--wpa_supplicant/examples/p2p/p2p_stop_find.py2
-rwxr-xr-xwpa_supplicant/examples/wpas-dbus-new.py4
-rwxr-xr-xwpa_supplicant/examples/wpas-test.py4
-rwxr-xr-xwpa_supplicant/examples/wps-nfc.py20
13 files changed, 39 insertions, 39 deletions
diff --git a/wpa_supplicant/examples/dpp-qrcode.py b/wpa_supplicant/examples/dpp-qrcode.py
index e2a00c9..f40f961 100755
--- a/wpa_supplicant/examples/dpp-qrcode.py
+++ b/wpa_supplicant/examples/dpp-qrcode.py
@@ -24,7 +24,7 @@ def wpas_connect():
if os.path.isdir(wpas_ctrl):
try:
ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)]
- except OSError, error:
+ except OSError as error:
print "Could not find wpa_supplicant: ", error
return None
@@ -36,7 +36,7 @@ def wpas_connect():
try:
wpas = wpaspy.Ctrl(ctrl)
return wpas
- except Exception, e:
+ except Exception as e:
pass
return None
diff --git a/wpa_supplicant/examples/p2p-nfc.py b/wpa_supplicant/examples/p2p-nfc.py
index 91eba28..646f452 100755
--- a/wpa_supplicant/examples/p2p-nfc.py
+++ b/wpa_supplicant/examples/p2p-nfc.py
@@ -53,7 +53,7 @@ def wpas_connect():
if os.path.isdir(wpas_ctrl):
try:
ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)]
- except OSError, error:
+ except OSError as error:
print "Could not find wpa_supplicant: ", error
return None
@@ -69,7 +69,7 @@ def wpas_connect():
print "Trying to use control interface " + ctrl
wpas = wpaspy.Ctrl(ctrl)
return wpas
- except Exception, e:
+ except Exception as e:
pass
return None
@@ -169,7 +169,7 @@ def p2p_handover_client(llc):
print "Handover request (pre-WPS):"
try:
print message.pretty()
- except Exception, e:
+ except Exception as e:
print e
data = wpas_get_handover_req_wps()
@@ -181,7 +181,7 @@ def p2p_handover_client(llc):
print "Handover request:"
try:
print message.pretty()
- except Exception, e:
+ except Exception as e:
print e
print str(message).encode("hex")
@@ -194,7 +194,7 @@ def p2p_handover_client(llc):
summary("Handover connection refused")
client.close()
return
- except Exception, e:
+ except Exception as e:
summary("Other exception: " + str(e))
client.close()
return
@@ -220,14 +220,14 @@ def p2p_handover_client(llc):
print "Received message"
try:
print message.pretty()
- except Exception, e:
+ except Exception as e:
print e
print str(message).encode("hex")
message = nfc.ndef.HandoverSelectMessage(message)
summary("Handover select received")
try:
print message.pretty()
- except Exception, e:
+ except Exception as e:
print e
for carrier in message.carriers:
@@ -286,7 +286,7 @@ class HandoverServer(nfc.handover.HandoverServer):
print "HandoverServer - request received"
try:
print "Parsed handover request: " + request.pretty()
- except Exception, e:
+ except Exception as e:
print e
sel = nfc.ndef.HandoverSelectMessage(version="1.2")
@@ -302,7 +302,7 @@ class HandoverServer(nfc.handover.HandoverServer):
print "Carrier record:"
try:
print carrier.record.pretty()
- except Exception, e:
+ except Exception as e:
print e
data = wpas_get_handover_sel()
if data is None:
@@ -332,7 +332,7 @@ class HandoverServer(nfc.handover.HandoverServer):
print "Carrier record:"
try:
print carrier.record.pretty()
- except Exception, e:
+ except Exception as e:
print e
data = wpas_get_handover_sel_wps()
if data is None:
@@ -355,7 +355,7 @@ class HandoverServer(nfc.handover.HandoverServer):
print "Handover select:"
try:
print sel.pretty()
- except Exception, e:
+ except Exception as e:
print e
print str(sel).encode("hex")
@@ -443,7 +443,7 @@ def wps_write_p2p_handover_sel(clf, wait_remove=True):
print "Handover select:"
try:
print p2p_sel_data.pretty()
- except Exception, e:
+ except Exception as e:
print e
print str(p2p_sel_data).encode("hex")
@@ -459,7 +459,7 @@ def rdwr_connected(tag):
print "NDEF tag: " + tag.type
try:
print tag.ndef.message.pretty()
- except Exception, e:
+ except Exception as e:
print e
success = p2p_tag_read(tag)
if only_one and success:
@@ -636,7 +636,7 @@ def main():
'on-connect': llcp_connected},
terminate=terminate_loop):
break
- except Exception, e:
+ except Exception as e:
print "clf.connect failed"
global srv
diff --git a/wpa_supplicant/examples/p2p/p2p_connect.py b/wpa_supplicant/examples/p2p/p2p_connect.py
index 59b0a9d..cb12081 100644
--- a/wpa_supplicant/examples/p2p/p2p_connect.py
+++ b/wpa_supplicant/examples/p2p/p2p_connect.py
@@ -118,7 +118,7 @@ class P2P_Connect():
{'Ifname': ifname, 'Driver': 'test'})
time.sleep(1)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
if not str(exc).startswith(
self.wpas_dbus_interface + \
".InterfaceExists:"):
@@ -209,7 +209,7 @@ class P2P_Connect():
result_pin = self.p2p_interface.Connect(
self.p2p_connect_arguements)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
raise exc
if (self.wps_method == 'pin' and \
diff --git a/wpa_supplicant/examples/p2p/p2p_disconnect.py b/wpa_supplicant/examples/p2p/p2p_disconnect.py
index c3e39b3..9ea2c5c 100644
--- a/wpa_supplicant/examples/p2p/p2p_disconnect.py
+++ b/wpa_supplicant/examples/p2p/p2p_disconnect.py
@@ -81,7 +81,7 @@ class P2P_Disconnect (threading.Thread):
try:
self.path = self.wpas.GetInterface(
self.interface_name)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
error = 'Error:\n Interface ' + self.interface_name \
+ ' was not found'
print error
diff --git a/wpa_supplicant/examples/p2p/p2p_find.py b/wpa_supplicant/examples/p2p/p2p_find.py
index 973d46a..9c860d1 100644
--- a/wpa_supplicant/examples/p2p/p2p_find.py
+++ b/wpa_supplicant/examples/p2p/p2p_find.py
@@ -85,7 +85,7 @@ class P2P_Find (threading.Thread):
try:
self.path = self.wpas.GetInterface(
self.interface_name)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
error = 'Error:\n Interface ' + self.interface_name \
+ ' was not found'
print error
diff --git a/wpa_supplicant/examples/p2p/p2p_flush.py b/wpa_supplicant/examples/p2p/p2p_flush.py
index ff8509d..5dfe642 100644
--- a/wpa_supplicant/examples/p2p/p2p_flush.py
+++ b/wpa_supplicant/examples/p2p/p2p_flush.py
@@ -81,7 +81,7 @@ class P2P_Flush (threading.Thread):
try:
self.path = self.wpas.GetInterface(
self.interface_name)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
error = 'Error:\n Interface ' + self.interface_name \
+ ' was not found'
print error
diff --git a/wpa_supplicant/examples/p2p/p2p_group_add.py b/wpa_supplicant/examples/p2p/p2p_group_add.py
index 5c8fdaf..4e64892 100644
--- a/wpa_supplicant/examples/p2p/p2p_group_add.py
+++ b/wpa_supplicant/examples/p2p/p2p_group_add.py
@@ -99,7 +99,7 @@ class P2P_Group_Add (threading.Thread):
try:
self.path = self.wpas.GetInterface(
self.interface_name)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
error = 'Error:\n Interface ' + self.interface_name \
+ ' was not found'
print error
diff --git a/wpa_supplicant/examples/p2p/p2p_invite.py b/wpa_supplicant/examples/p2p/p2p_invite.py
index 6deb397..9413f02 100644
--- a/wpa_supplicant/examples/p2p/p2p_invite.py
+++ b/wpa_supplicant/examples/p2p/p2p_invite.py
@@ -96,7 +96,7 @@ class P2P_Invite (threading.Thread):
try:
self.path = self.wpas.GetInterface(
self.interface_name)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
error = 'Error:\n Interface ' + self.interface_name \
+ ' was not found'
print error
diff --git a/wpa_supplicant/examples/p2p/p2p_listen.py b/wpa_supplicant/examples/p2p/p2p_listen.py
index bb3c1e4..1dd61f6 100644
--- a/wpa_supplicant/examples/p2p/p2p_listen.py
+++ b/wpa_supplicant/examples/p2p/p2p_listen.py
@@ -82,7 +82,7 @@ class P2P_Listen(threading.Thread):
try:
self.path = self.wpas.GetInterface(
self.interface_name)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
error = 'Error:\n Interface ' + self.interface_name \
+ ' was not found'
print error
diff --git a/wpa_supplicant/examples/p2p/p2p_stop_find.py b/wpa_supplicant/examples/p2p/p2p_stop_find.py
index f6c03b0..31b54dd 100644
--- a/wpa_supplicant/examples/p2p/p2p_stop_find.py
+++ b/wpa_supplicant/examples/p2p/p2p_stop_find.py
@@ -83,7 +83,7 @@ class P2P_Stop_Find (threading.Thread):
try:
self.path = self.wpas.GetInterface(
self.interface_name)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
error = 'Error:\n Interface ' + self.interface_name \
+ ' was not found'
print error
diff --git a/wpa_supplicant/examples/wpas-dbus-new.py b/wpa_supplicant/examples/wpas-dbus-new.py
index 25072ce..885262c 100755
--- a/wpa_supplicant/examples/wpas-dbus-new.py
+++ b/wpa_supplicant/examples/wpas-dbus-new.py
@@ -123,14 +123,14 @@ def main():
path = None
try:
path = wpas.GetInterface(ifname)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
if not str(exc).startswith("fi.w1.wpa_supplicant1.InterfaceUnknown:"):
raise exc
try:
path = wpas.CreateInterface({'Ifname': ifname, 'Driver': 'test'})
time.sleep(1)
- except dbus.DBusException, exc:
+ except dbus.DBusException as exc:
if not str(exc).startswith("fi.w1.wpa_supplicant1.InterfaceExists:"):
raise exc
diff --git a/wpa_supplicant/examples/wpas-test.py b/wpa_supplicant/examples/wpas-test.py
index fd7f73d..31713ca 100755
--- a/wpa_supplicant/examples/wpas-test.py
+++ b/wpa_supplicant/examples/wpas-test.py
@@ -37,12 +37,12 @@ def main():
path = None
try:
path = wpas.getInterface(ifname)
- except dbus.dbus_bindings.DBusException, exc:
+ except dbus.dbus_bindings.DBusException as exc:
if str(exc) != "wpa_supplicant knows nothing about this interface.":
raise exc
try:
path = wpas.addInterface(ifname, {'driver': dbus.Variant('wext')})
- except dbus.dbus_bindings.DBusException, exc:
+ except dbus.dbus_bindings.DBusException as exc:
if str(exc) != "wpa_supplicant already controls this interface.":
raise exc
diff --git a/wpa_supplicant/examples/wps-nfc.py b/wpa_supplicant/examples/wps-nfc.py
index 7459eb9..2e68693 100755
--- a/wpa_supplicant/examples/wps-nfc.py
+++ b/wpa_supplicant/examples/wps-nfc.py
@@ -46,7 +46,7 @@ def wpas_connect():
if os.path.isdir(wpas_ctrl):
try:
ifaces = [os.path.join(wpas_ctrl, i) for i in os.listdir(wpas_ctrl)]
- except OSError, error:
+ except OSError as error:
print "Could not find wpa_supplicant: ", error
return None
@@ -58,7 +58,7 @@ def wpas_connect():
try:
wpas = wpaspy.Ctrl(ctrl)
return wpas
- except Exception, e:
+ except Exception as e:
pass
return None
@@ -164,7 +164,7 @@ class HandoverServer(nfc.handover.HandoverServer):
summary("HandoverServer - request received")
try:
print "Parsed handover request: " + request.pretty()
- except Exception, e:
+ except Exception as e:
print e
sel = nfc.ndef.HandoverSelectMessage(version="1.2")
@@ -191,7 +191,7 @@ class HandoverServer(nfc.handover.HandoverServer):
print "Handover select:"
try:
print sel.pretty()
- except Exception, e:
+ except Exception as e:
print e
print str(sel).encode("hex")
@@ -217,7 +217,7 @@ def wps_handover_init(llc):
print "Handover request:"
try:
print message.pretty()
- except Exception, e:
+ except Exception as e:
print e
print str(message).encode("hex")
@@ -230,7 +230,7 @@ def wps_handover_init(llc):
summary("Handover connection refused")
client.close()
return
- except Exception, e:
+ except Exception as e:
summary("Other exception: " + str(e))
client.close()
return
@@ -256,14 +256,14 @@ def wps_handover_init(llc):
print "Received message"
try:
print message.pretty()
- except Exception, e:
+ except Exception as e:
print e
print str(message).encode("hex")
message = nfc.ndef.HandoverSelectMessage(message)
summary("Handover select received")
try:
print message.pretty()
- except Exception, e:
+ except Exception as e:
print e
for carrier in message.carriers:
@@ -376,7 +376,7 @@ def rdwr_connected(tag):
print "NDEF tag: " + tag.type
try:
print tag.ndef.message.pretty()
- except Exception, e:
+ except Exception as e:
print e
success = wps_tag_read(tag, not only_one)
if only_one and success:
@@ -507,7 +507,7 @@ def main():
'on-connect': llcp_connected},
terminate=terminate_loop):
break
- except Exception, e:
+ except Exception as e:
print "clf.connect failed"
global srv