From d85ad70ef457cfd35a1c738dd3b815580a1d439f Mon Sep 17 00:00:00 2001 From: Jochen Keil <1392715+jchnkl@users.noreply.github.com> Date: Mon, 14 Jun 2021 16:04:22 +0200 Subject: [PATCH] Fix TypeErrors * Use bytes-like objects instead of str * basestring does not exist in python 3 --- wpactrl/wpa_ctrl_iface.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wpactrl/wpa_ctrl_iface.py b/wpactrl/wpa_ctrl_iface.py index 361357e..3a5a329 100644 --- a/wpactrl/wpa_ctrl_iface.py +++ b/wpactrl/wpa_ctrl_iface.py @@ -91,12 +91,12 @@ def wpa_ctrl_request(ctrl, cmd, msg_cb=None, reply_len=4096): def wpa_ctrl_attach_helper(ctrl, attach): - ret = wpa_ctrl_request(ctrl, 'ATTACH' if attach else 'DETACH') + ret = wpa_ctrl_request(ctrl, b'ATTACH' if attach else b'DETACH') - if isinstance(ret, basestring): - return ret == 'OK\n' - else: - return ret + if ret: + return ret == b'OK\n' + + return False def wpa_ctrl_attach(ctrl): '''