[gtk-mac-bundler] make Python3.9 compatible - adapt env and plistlib.load()



commit 58d951c83622b4748ac027623646944c6e2ab548
Author: MC51 (Michael) <mc51 users noreply github com>
Date:   Mon May 10 22:18:02 2021 +0200

    make Python3.9 compatible - adapt env and plistlib.load()

 bundler/bundler.py | 3 ++-
 bundler/project.py | 3 ++-
 gtk-mac-bundler.in | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/bundler/bundler.py b/bundler/bundler.py
index 11c158f..dd7899a 100644
--- a/bundler/bundler.py
+++ b/bundler/bundler.py
@@ -18,7 +18,8 @@ class Bundler(object):
         self.project_dir = project.get_project_dir()
 
         plist_path = self.project.get_plist_path()
-        self.plist = plistlib.readPlist(plist_path)
+        with open(plist_path, "rb") as f:
+            self.plist = plistlib.load(f)
 
         # List of paths that should be recursively searched for
         # binaries that are used to find library dependencies.
diff --git a/bundler/project.py b/bundler/project.py
index 5517920..3da333e 100644
--- a/bundler/project.py
+++ b/bundler/project.py
@@ -510,7 +510,8 @@ class Project(object):
 
         plist_path = self.get_plist_path()
         try:
-            plist = plistlib.readPlist(plist_path)
+            with open(plist_path, "rb") as f:
+                plist = plistlib.load(f)
         except EnvironmentError as e:
             if e.errno == errno.ENOENT:
                 print("Info.plist file not found: " + plist_path)
diff --git a/gtk-mac-bundler.in b/gtk-mac-bundler.in
index 668efc3..34ef507 100644
--- a/gtk-mac-bundler.in
+++ b/gtk-mac-bundler.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 import sys
 sys.path.insert(0, '@PATH@')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]