Skip to content

Commit 80602f7

Browse files
committed
Convert exec_ calls to exec and remove compat checks
Note: This change breaks support for Qt4 and older versions of Qt5. exec_ was a reserved keyword in python 2, its not in python 3. PyQt6 has dropped support for exec_ and its deprecated in PySide6. Modern Qt5 supports both. This requires disabling py2-3 compatibility checking as modernize doesn't like using `exec` as a object property. I'm also removing the compileall check as it's assumed that the linting flake8/black checks will cover checking for syntax errors.
1 parent 5f67bfa commit 80602f7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

preditor/gui/dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def exec_(self):
134134
self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose, False)
135135

136136
# execute the dialog
137-
return QDialog.exec_(self)
137+
return super().exec()
138138

139139
def setGeometry(self, *args):
140140
"""

preditor/gui/drag_tab_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def mouseMoveEvent(self, event): # noqa: N802
5454
drag.setHotSpot(event_pos - pos_in_tab)
5555
cursor = QCursor(Qt.CursorShape.OpenHandCursor)
5656
drag.setDragCursor(cursor.pixmap(), Qt.DropAction.MoveAction)
57-
action = drag.exec_(Qt.DropAction.MoveAction)
57+
action = drag.exec(Qt.DropAction.MoveAction)
5858
# If the user didn't successfully add this to a new tab widget, restore
5959
# the tab to the original location.
6060
if action == Qt.DropAction.IgnoreAction:

preditor/gui/loggerwindow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def setup_run_workbox(self):
489489

490490
def openSetPreferredTextEditorDialog(self):
491491
dlg = SetTextEditorPathDialog(parent=self)
492-
dlg.exec_()
492+
dlg.exec()
493493

494494
def focusToConsole(self):
495495
"""Move focus to the console"""
@@ -872,7 +872,7 @@ def maybeDisplayDialog(self, dialog):
872872
if dialog.objectName() in self.dont_ask_again:
873873
return
874874

875-
dialog.exec_()
875+
dialog.exec()
876876

877877
def restartLogger(self):
878878
"""Closes this PrEditor instance and starts a new process with the same

0 commit comments

Comments
 (0)