diff options
author | Preston Hunt <preston.hunt@intel.com> | 2017-01-31 01:25:03 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2017-02-04 18:57:38 (GMT) |
commit | 945604a355c4c919587faefaced2b966f350defe (patch) | |
tree | a68ab48acb4d8cca141af8f199e9cd2570de6611 /wpaspy | |
parent | 4d6e79f867c66f8d56ce6ea12c1f616b7c7981b9 (diff) | |
download | hostap-945604a355c4c919587faefaced2b966f350defe.zip hostap-945604a355c4c919587faefaced2b966f350defe.tar.gz hostap-945604a355c4c919587faefaced2b966f350defe.tar.bz2 |
Update wpaspy.py to be python3 compatible
Make minor changes to wpaspy module that enables it to run in either
python2 or python3.
Signed-off-by: Preston Hunt <preston.hunt@intel.com>
Diffstat (limited to 'wpaspy')
-rw-r--r-- | wpaspy/wpaspy.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wpaspy/wpaspy.py b/wpaspy/wpaspy.py index c2aace0..5f614c7 100644 --- a/wpaspy/wpaspy.py +++ b/wpaspy/wpaspy.py @@ -6,6 +6,8 @@ # This software may be distributed under the terms of the BSD license. # See README for more details. +from __future__ import print_function + import os import stat import socket @@ -38,7 +40,7 @@ class Ctrl: self.s.bind(self.local) try: self.s.connect(self.dest) - except Exception, e: + except Exception as e: self.s.close() os.unlink(self.local) raise @@ -57,7 +59,7 @@ class Ctrl: self.cookie = reply self.port = port except: - print "connect exception ", path, str(port) + print("connect exception ", path, str(port)) if self.s != None: self.s.close() raise @@ -70,7 +72,7 @@ class Ctrl: if self.attached: try: self.detach() - except Exception, e: + except Exception as e: # Need to ignore this allow the socket to be closed self.attached = False pass @@ -114,7 +116,7 @@ class Ctrl: if self.attached: try: self.detach() - except Exception, e: + except Exception as e: # Need to ignore this to allow the socket to be closed self.attached = False self.request("TERMINATE") |