scripts/install.py

changeset 8214
51f0d3e047ec
parent 8205
4a0f1f896341
child 8240
93b8a353c4bf
diff -r 4cdfe4fbdd26 -r 51f0d3e047ec scripts/install.py
--- a/scripts/install.py	Sat Apr 10 16:12:29 2021 +0200
+++ b/scripts/install.py	Sat Apr 10 16:13:07 2021 +0200
@@ -236,10 +236,7 @@
             qtDataDir = QLibraryInfo.location(QLibraryInfo.DataPath)
         except ImportError:
             qtDataDir = None
-    if qtDataDir:
-        apisDir = os.path.join(qtDataDir, "qsci", "api")
-    else:
-        apisDir = None
+    apisDir = os.path.join(qtDataDir, "qsci", "api") if qtDataDir else None
 
 
 def copyToFile(name, text):
@@ -1939,15 +1936,16 @@
         elif opt == "-z":
             doCompile = False
         elif opt == "-f":
-            try:
-                exec(compile(open(arg).read(), arg, 'exec'), globals())
-                # secok
-                if len(cfg) != configLength:
-                    print("The configuration dictionary in '{0}' is incorrect."
-                          " Aborting".format(arg))
-                    exit(6)
-            except Exception:
-                cfg = {}
+            with open(arg) as f:
+                try:
+                    exec(compile(f.read(), arg, 'exec'), globals())
+                    # secok
+                    if len(cfg) != configLength:
+                        print("The configuration dictionary in '{0}' is"
+                              " incorrect. Aborting".format(arg))
+                        exit(6)
+                except Exception:
+                    cfg = {}
         elif opt == "-m":
             macAppBundleName = arg
         elif opt == "-n":

eric ide

mercurial