PluginPyInstaller.py

changeset 35
d9b3cadaf707
parent 34
784d24a61fdf
child 38
fc9ef9dcd51a
--- a/PluginPyInstaller.py	Wed Dec 30 11:02:06 2020 +0100
+++ b/PluginPyInstaller.py	Mon Apr 26 18:03:44 2021 +0200
@@ -7,6 +7,7 @@
 Module implementing the PyInstaller interface plug-in.
 """
 
+import contextlib
 import os
 import platform
 import shutil
@@ -27,7 +28,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "2.1.0"
+version = "2.2.0"
 className = "PyInstallerPlugin"
 packageName = "PyInstaller"
 shortDescription = "Show dialogs to configure and execute PyInstaller."
@@ -106,7 +107,7 @@
         
         def getExePath(branch, access, versionStr):
             exes = []
-            try:
+            with contextlib.suppress(WindowsError, OSError):
                 software = winreg.OpenKey(branch, 'Software', 0, access)
                 python = winreg.OpenKey(software, 'Python', 0, access)
                 pcore = winreg.OpenKey(python, 'PythonCore', 0, access)
@@ -120,8 +121,6 @@
                 exe = os.path.join(installpath, 'Scripts', 'pyi-makespec.exe')
                 if os.access(exe, os.X_OK):
                     exes.append(exe)
-            except (WindowsError, OSError):   # __IGNORE_WARNING__
-                pass
             return exes
         
         versionSuffixes = ["", "-32", "-64"]
@@ -247,7 +246,7 @@
         @param ui reference to the user interface object
         @type UI.UserInterface
         """
-        super(PyInstallerPlugin, self).__init__(ui)
+        super().__init__(ui)
         self.__ui = ui
         
         self.__initialize()

eric ide

mercurial