Changed calls of exec_() into exec(). release-7.1.0

Wed, 14 Oct 2020 18:42:59 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 14 Oct 2020 18:42:59 +0200
changeset 127
a76379d552f2
parent 126
0ead13538037
child 128
f20c104c644e

Changed calls of exec_() into exec().

ChangeLog file | annotate | diff | comparison | revisions
CxFreeze/CxfreezeConfigDialog.py file | annotate | diff | comparison | revisions
PluginCxFreeze.py file | annotate | diff | comparison | revisions
PluginCxFreeze.zip file | annotate | diff | comparison | revisions
--- a/ChangeLog	Tue Jun 23 19:23:45 2020 +0200
+++ b/ChangeLog	Wed Oct 14 18:42:59 2020 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 7.1.0:
+- changed exec_() into exec()
+
 Version 7.0.0:
 - removed support for Python2
 
--- a/CxFreeze/CxfreezeConfigDialog.py	Tue Jun 23 19:23:45 2020 +0200
+++ b/CxFreeze/CxfreezeConfigDialog.py	Wed Oct 14 18:42:59 2020 +0200
@@ -46,9 +46,9 @@
         QFileDialog.__init__(self, parent, caption, directory, fileFilter)
         self.setFileMode(QFileDialog.ExistingFiles)
     
-    def exec_(self):
+    def exec(self):
         """
-        Public slot to finalize initialisation and start the event loop.
+        Public slot to finalize initialization and start the event loop.
         
         @return accepted or rejected (QDialog.DialogCode)
         """
@@ -58,7 +58,7 @@
         self.tree = self.findChild(QTreeView)
         self.tree.selectionModel().selectionChanged.connect(
             self.on_selectionChanged)
-        return QFileDialog.exec_(self)
+        return QFileDialog.exec(self)
     
     def accept(self):
         """
@@ -129,7 +129,7 @@
         options |= QFileDialog.DontUseNativeDialog
         dlg = DirFileDialog(parent, caption, directory, fileFilter)
         dlg.setOptions(options)
-        dlg.exec_()
+        dlg.exec()
         return dlg.selectedFilesFolders
 
 
--- a/PluginCxFreeze.py	Tue Jun 23 19:23:45 2020 +0200
+++ b/PluginCxFreeze.py	Wed Oct 14 18:42:59 2020 +0200
@@ -24,7 +24,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "7.0.0"
+version = "7.1.0"
 className = "CxFreezePlugin"
 packageName = "CxFreeze"
 shortDescription = "Show the CxFreeze dialogs."
@@ -178,20 +178,17 @@
         _exePy3 = set()
         versionArgs = ["-c", "import sys; print(sys.version_info[0])"]
         for exe in exes:
-            try:
-                f = open(exe, "r")
+            with open(exe, "r") as f:
                 line0 = f.readline()
-                program = line0.replace("#!", "").strip()
-                process = QProcess()
-                process.start(program, versionArgs)
-                process.waitForFinished(5000)
-                # get a QByteArray of the output
-                versionBytes = process.readAllStandardOutput()
-                versionStr = str(versionBytes, encoding='utf-8').strip()
-                if versionStr == "3":
-                    _exePy3.add(exe)
-            finally:
-                f.close()
+            program = line0.replace("#!", "").strip()
+            process = QProcess()
+            process.start(program, versionArgs)
+            process.waitForFinished(5000)
+            # get a QByteArray of the output
+            versionBytes = process.readAllStandardOutput()
+            versionStr = str(versionBytes, encoding='utf-8').strip()
+            if versionStr == "3":
+                _exePy3.add(exe)
         
         executables = _exePy3
     
@@ -373,7 +370,7 @@
         from CxFreeze.CxfreezeConfigDialog import CxfreezeConfigDialog
         parms = project.getData('PACKAGERSPARMS', "CXFREEZE")
         dlg = CxfreezeConfigDialog(project, exe, parms)
-        if dlg.exec_() == QDialog.Accepted:
+        if dlg.exec() == QDialog.Accepted:
             args, parms = dlg.generateParameters()
             project.setData('PACKAGERSPARMS', "CXFREEZE", parms)
             
@@ -384,7 +381,7 @@
             res = dia.start(args, parms, project.ppath,
                             project.getMainScript())
             if res:
-                dia.exec_()
+                dia.exec()
 
 #
 # eflag: noqa = M801
Binary file PluginCxFreeze.zip has changed

eric ide

mercurial