Skip to content

Commit

Permalink
Fixing urlopen not returning text.
Browse files Browse the repository at this point in the history
Fixes #31.
  • Loading branch information
mithro committed Jul 6, 2019
1 parent 2d8fd8c commit a77f828
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions programmer/tinyprog/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,11 @@ def perform_bootloader_update(port):
uuid = m[u"boardmeta"][u"uuid"]

# download bootloader update information
bootloader_update_info = json.loads(
urlopen(m[u"bootmeta"][u"update"] + "/bootloader.json").read())
bootloader_json_data = urlopen(
m[u"bootmeta"][u"update"] + "/bootloader.json").read()
if isinstance(bootloader_json_data, bytes):
bootloader_json_data = bootloader_json_data.decode('utf-8')
bootloader_update_info = json.loads(bootloader_json_data)

# ask permission to update the board
print("")
Expand Down

0 comments on commit a77f828

Please sign in to comment.