--- 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":