eric6/QScintilla/Shell.py

changeset 8222
5994b80b8760
parent 8218
7c09585bd960
child 8235
78e6d29eb773
--- a/eric6/QScintilla/Shell.py	Sun Apr 11 16:53:48 2021 +0200
+++ b/eric6/QScintilla/Shell.py	Sun Apr 11 18:45:10 2021 +0200
@@ -892,26 +892,26 @@
         
         if (
             not self.__windowed and
-            Preferences.getDebugger("ShowExceptionInShell")
+            Preferences.getDebugger("ShowExceptionInShell") and
+            exceptionType
         ):
-            if exceptionType:
-                if stackTrace:
-                    self.__write(
-                        self.tr('Exception "{0}"\n{1}\nFile: {2}, Line: {3}\n')
-                        .format(
-                            exceptionType,
-                            exceptionMessage,
-                            stackTrace[0][0],
-                            stackTrace[0][1]
-                        )
+            if stackTrace:
+                self.__write(
+                    self.tr('Exception "{0}"\n{1}\nFile: {2}, Line: {3}\n')
+                    .format(
+                        exceptionType,
+                        exceptionMessage,
+                        stackTrace[0][0],
+                        stackTrace[0][1]
                     )
-                else:
-                    self.__write(
-                        self.tr('Exception "{0}"\n{1}\n')
-                        .format(
-                            exceptionType,
-                            exceptionMessage)
-                    )
+                )
+            else:
+                self.__write(
+                    self.tr('Exception "{0}"\n{1}\n')
+                    .format(
+                        exceptionType,
+                        exceptionMessage)
+                )
         
     def __clientSyntaxError(self, message, filename, lineNo, characterNo):
         """

eric ide

mercurial