Skip to content

Commit

Permalink
Merge pull request #473 from aabadie/fix_hex_loader_python3
Browse files Browse the repository at this point in the history
flash/loader: fix python3 compatibility issue with hex files
  • Loading branch information
flit authored Dec 14, 2018
2 parents 5c05b0f + 8029113 commit 243a97e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyocd/flash/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def program(self, file_or_path, format=None, **kwargs):
try:
# Open the file if a path was provided.
if isPath:
file_obj = open(file_or_path, "rb")
mode = 'rb'
if format == 'hex':
# hex file must be read as plain text file
mode = 'r'
file_obj = open(file_or_path, mode)
else:
file_obj = file_or_path

Expand Down

0 comments on commit 243a97e

Please sign in to comment.