install script: fixed some code style issues.

Sat, 10 Apr 2021 16:13:07 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 10 Apr 2021 16:13:07 +0200
changeset 8214
51f0d3e047ec
parent 8213
4cdfe4fbdd26
child 8215
fc5d68a6889e

install script: fixed some code style issues.

scripts/install.py file | annotate | diff | comparison | revisions
--- 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