aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/examples/wps-nfc.py
diff options
context:
space:
mode:
Diffstat (limited to 'wpa_supplicant/examples/wps-nfc.py')
-rwxr-xr-xwpa_supplicant/examples/wps-nfc.py20
1 files changed, 10 insertions, 10 deletions
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