Skip to content

Commit f9a1902

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 765e5be commit f9a1902

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
@@ -492,7 +492,7 @@ def setup_run_workbox(self):
492492

493493
def openSetPreferredTextEditorDialog(self):
494494
dlg = SetTextEditorPathDialog(parent=self)
495-
dlg.exec_()
495+
dlg.exec()
496496

497497
def focusToConsole(self):
498498
"""Move focus to the console"""
@@ -875,7 +875,7 @@ def maybeDisplayDialog(self, dialog):
875875
if dialog.objectName() in self.dont_ask_again:
876876
return
877877

878-
dialog.exec_()
878+
dialog.exec()
879879

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

0 commit comments

Comments
 (0)