From 48a3506d77098c4f36ccb15c63ff87cc2cadf089 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 17 Oct 2020 16:24:02 +0200 Subject: [PATCH] update ci to fix macos builds (#2079) update dmgbuild settings file --- .CI/dmg-settings.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.CI/dmg-settings.py b/.CI/dmg-settings.py index 6b068fa1b..80f33c4f1 100644 --- a/.CI/dmg-settings.py +++ b/.CI/dmg-settings.py @@ -1,9 +1,20 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -import biplist +import sys import os.path +# Before Python 3.4, use biplist; afterwards, use plistlib +if sys.version_info < (3, 4): + import biplist + def read_plist(path): + return biplist.readPlist(path) +else: + import plistlib + def read_plist(path): + with open(path, 'rb') as f: + return plistlib.load(f) + # # Example settings file for dmgbuild # @@ -22,7 +33,7 @@ appname = os.path.basename(application) def icon_from_app(app_path): plist_path = os.path.join(app_path, 'Contents', 'Info.plist') - plist = biplist.readPlist(plist_path) + plist = read_plist(plist_path) icon_name = plist['CFBundleIconFile'] icon_root,icon_ext = os.path.splitext(icon_name) if not icon_ext: