Skip to content

Commit

Permalink
Merge pull request #100 from MPIB/fix_friendly_name_decode
Browse files Browse the repository at this point in the history
Fix handling bytes-like product-name from ioreg
  • Loading branch information
grahamgilbert authored Apr 7, 2022
2 parents 5d2bb20 + 5abda24 commit 266b64b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions payload/usr/local/sal/checkin_modules/machine_checkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ def get_friendly_model(serial, udid):
return (
data[0]
.get("product-name")
.encode("ascii", "ignore")
.decode()
.strip()
.decode("ascii", "ignore")
.strip().strip('\x00').strip()
)
except:
pass
Expand Down

0 comments on commit 266b64b

Please sign in to comment.