Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Commit fc1c63a

Browse files
committed
Fixed the python 3 compatibility
1 parent 1e1bcb9 commit fc1c63a

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

u2flib_host/authenticate.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,16 @@ def parse_args():
103103
def main():
104104
args = parse_args()
105105

106-
facet = text_type(args.facet, sys.stdin.encoding or sys.getdefaultencoding())
106+
facet = text_type(args.facet)
107107
if args.infile:
108108
with open(args.infile, 'r') as f:
109109
data = f.read()
110110
else:
111111
if sys.stdin.isatty():
112112
sys.stderr.write('Enter AuthenticateRequest JSON data...\n')
113-
data = sys.stdin.read()
114-
115-
params = json.loads(data, object_hook=u2str)
113+
data = sys.stdin.readline()
116114

115+
params = json.loads(data)
117116
if args.soft:
118117
from u2flib_host.soft import SoftU2FDevice
119118
devices = [SoftU2FDevice(args.soft)]

u2flib_host/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def get_supported_versions(self):
7272
"""
7373
if not hasattr(self, '_versions'):
7474
try:
75-
self._versions = [self.send_apdu(INS_GET_VERSION)]
75+
self._versions = [self.send_apdu(INS_GET_VERSION).decode()]
7676
except exc.APDUError as e:
7777
# v0 didn't support the instruction.
7878
self._versions = ['v0'] if e.code == 0x6d00 else []

0 commit comments

Comments
 (0)