@@ -47,8 +47,8 @@ def getFirstPlist(textString):
4747 more text-style plists.
4848 Returns a tuple - the first plist (if any) and the remaining
4949 string after the plist"""
50- plist_header = ' <?xml version'
51- plist_footer = ' </plist>'
50+ plist_header = b" <?xml version"
51+ plist_footer = b" </plist>"
5252 plist_start_index = textString.find(plist_header)
5353 if plist_start_index == -1:
5454 # not found
@@ -72,7 +72,7 @@ def dmg_has_sla(dmgpath):
7272 print("error getting imageinfo! %s, %s" % (result["return_code"], result["stderr"]))
7373 return False
7474 result_plist = result["stdout"]
75- imageinfo_dict = readPlistFromString (result_plist)
75+ imageinfo_dict = plistlib.loads (result_plist)
7676 properties = imageinfo_dict.get('Properties')
7777 if properties is not None:
7878 has_sla = properties.get('Software License Agreement', False)
@@ -86,7 +86,7 @@ def attachdmg(dmgpath):
8686 if info_result["return_code"] == 0:
8787 # parse the plist output
8888 (theplist, alltext) = getFirstPlist(info_result["stdout"])
89- info_dict = readPlistFromString (theplist)
89+ info_dict = plistlib.loads (theplist)
9090 volpaths = []
9191 if "images" in list(info_dict.keys()):
9292 for y in info_dict["images"]:
@@ -118,7 +118,7 @@ def attachdmg(dmgpath):
118118 if result["return_code"] == 0:
119119 # parse the plist output
120120 (theplist, alltext) = getFirstPlist(result["stdout"])
121- resultdict = readPlistFromString (theplist)
121+ resultdict = plistlib.loads (theplist)
122122 volpaths = []
123123 for x in resultdict["system-entities"]:
124124 if x["potentially-mountable"]:
0 commit comments