@@ -47,8 +47,8 @@ def getFirstPlist(textString):
47
47
more text-style plists.
48
48
Returns a tuple - the first plist (if any) and the remaining
49
49
string after the plist"""
50
- plist_header = ' <?xml version'
51
- plist_footer = ' </plist>'
50
+ plist_header = b" <?xml version"
51
+ plist_footer = b" </plist>"
52
52
plist_start_index = textString.find(plist_header)
53
53
if plist_start_index == -1:
54
54
# not found
@@ -72,7 +72,7 @@ def dmg_has_sla(dmgpath):
72
72
print("error getting imageinfo! %s, %s" % (result["return_code"], result["stderr"]))
73
73
return False
74
74
result_plist = result["stdout"]
75
- imageinfo_dict = readPlistFromString (result_plist)
75
+ imageinfo_dict = plistlib.loads (result_plist)
76
76
properties = imageinfo_dict.get('Properties')
77
77
if properties is not None:
78
78
has_sla = properties.get('Software License Agreement', False)
@@ -86,7 +86,7 @@ def attachdmg(dmgpath):
86
86
if info_result["return_code"] == 0:
87
87
# parse the plist output
88
88
(theplist, alltext) = getFirstPlist(info_result["stdout"])
89
- info_dict = readPlistFromString (theplist)
89
+ info_dict = plistlib.loads (theplist)
90
90
volpaths = []
91
91
if "images" in list(info_dict.keys()):
92
92
for y in info_dict["images"]:
@@ -118,7 +118,7 @@ def attachdmg(dmgpath):
118
118
if result["return_code"] == 0:
119
119
# parse the plist output
120
120
(theplist, alltext) = getFirstPlist(result["stdout"])
121
- resultdict = readPlistFromString (theplist)
121
+ resultdict = plistlib.loads (theplist)
122
122
volpaths = []
123
123
for x in resultdict["system-entities"]:
124
124
if x["potentially-mountable"]:
0 commit comments