--- 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): """