Fixes for some potential int casting issues

This commit is contained in:
CorpNewt 2018-10-18 12:42:27 -05:00 committed by GitHub
parent ab22fc6afd
commit 9dfb846041
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,10 +106,11 @@ class Disk:
pr = p_dict["partitions"][pr]
if pr.get("letter","").upper() == plt.upper():
# Found it - set all attributes
pr["size"] = int(psz)
pr["size"] = int(psz) if len(psz) else -1
pr["file system"] = pfs
pr["name"] = pnm
# Also need to set the parent drive's type
p_dict["type"] = int(ptp)
if len(ptp):
p_dict["type"] = int(ptp)
break
return p_disks