Skip to content

Commit 76cb7c9

Browse files
committed
Fix Qt enum access.
This was missed in the global fixing of enums for PyQt6 (now using _enum everywhere). To trigger, try to interactively save a figure but input an invalid format, e.g. "foo.bar".
1 parent 62978a2 commit 76cb7c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_qt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,8 @@ def save_figure(self, *args):
799799
except Exception as e:
800800
QtWidgets.QMessageBox.critical(
801801
self, "Error saving file", str(e),
802-
QtWidgets.QMessageBox.Ok, QtWidgets.QMessageBox.NoButton)
802+
_enum("QtWidgets.QMessageBox.StandardButton").Ok,
803+
_enum("QtWidgets.QMessageBox.StandardButton").NoButton)
803804

804805
def set_history_buttons(self):
805806
can_backward = self._nav_stack._pos > 0

0 commit comments

Comments
 (0)