src/eric7/Debugger/DebugUI.py

branch
eric7
changeset 10988
729202700a5a
parent 10928
46651e194fbe
child 11006
a671918232f3
diff -r ee81b245ae2c -r 729202700a5a src/eric7/Debugger/DebugUI.py
--- a/src/eric7/Debugger/DebugUI.py	Fri Oct 18 19:16:14 2024 +0200
+++ b/src/eric7/Debugger/DebugUI.py	Sun Oct 20 11:33:30 2024 +0200
@@ -1490,22 +1490,40 @@
                                 | EricMessageBox.Yes
                                 | EricMessageBox.Ignore
                             )
-                        res = EricMessageBox.critical(
-                            self.ui,
-                            Program,
-                            self.tr(
-                                "<p>The debugged program raised the exception"
-                                ' <b>{0}</b><br>"<b>{1}</b>"<br>'
-                                "File: <b>{2}</b>, Line: <b>{3}</b></p>"
-                                "<p>Break here?</p>"
-                            ).format(
-                                exceptionType,
-                                EricUtilities.html_encode(exceptionMessage),
-                                stackTrace[0][0],
-                                stackTrace[0][1],
-                            ),
-                            buttons,
-                            EricMessageBox.No,
+                        filename = stackTrace[0][0]
+                        res = (
+                            EricMessageBox.critical(
+                                self.ui,
+                                Program,
+                                self.tr(
+                                    "<p>The debugged program raised the exception"
+                                    ' <b>{0}</b><br>"<b>{1}</b>"<br>'
+                                    "File: <b>{2}</b>, Line: <b>{3}</b></p>"
+                                    "<p>Break here?</p>"
+                                ).format(
+                                    exceptionType,
+                                    EricUtilities.html_encode(exceptionMessage),
+                                    filename,
+                                    stackTrace[0][1],
+                                ),
+                                buttons,
+                                EricMessageBox.No,
+                            )
+                            if Utilities.MimeTypes.isTextFile(filename)
+                            else EricMessageBox.critical(
+                                self.ui,
+                                Program,
+                                self.tr(
+                                    "<p>The debugged program raised the exception"
+                                    ' <b>{0}</b><br>"<b>{1}</b>"<br>'
+                                    "File: <b>{2}</b>, Line: <b>{3}</b></p>"
+                                ).format(
+                                    exceptionType,
+                                    EricUtilities.html_encode(exceptionMessage),
+                                    filename,
+                                    stackTrace[0][1],
+                                ),
+                            )
                         )
                     else:
                         res = EricMessageBox.critical(

eric ide

mercurial