From c7c74871074e96d87188c4975061b41cb0cb235e Mon Sep 17 00:00:00 2001 From: Grant Cohoe Date: Sun, 10 Oct 2021 14:55:33 -0400 Subject: [PATCH] Maybe fixes #36 by doing byte/string conversion --- pyric/utils/rfkill.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyric/utils/rfkill.py b/pyric/utils/rfkill.py index ce0416e..66f011c 100644 --- a/pyric/utils/rfkill.py +++ b/pyric/utils/rfkill.py @@ -131,6 +131,7 @@ def rfkill_unblock(idx): fout = None try: rfke = rfkh.rfkill_event(idx,rfkh.RFKILL_TYPE_ALL,rfkh.RFKILL_OP_CHANGE,0,0) + if _PY3_: rfke = rfke.decode('ascii') fout = open(dpath, 'w') fout.write(rfke) except struct.error as e: @@ -231,4 +232,4 @@ def gettype(idx): except IOError: raise pyric.error(errno.ENODEV,"No device at {0}".format(idx)) finally: - if fin: fin.close() \ No newline at end of file + if fin: fin.close()