diff -r 331569d44b19 -r 684261ef2165 eric6/E5Gui/E5ErrorMessage.py --- a/eric6/E5Gui/E5ErrorMessage.py Sun Sep 01 17:44:33 2019 +0200 +++ b/eric6/E5Gui/E5ErrorMessage.py Sun Sep 01 19:40:53 2019 +0200 @@ -98,21 +98,17 @@ _filterSettings.setValue("MessageFilters", filters) -def messageHandler(msgType, *args): +def messageHandler(msgType, context, message): """ Module function handling messages. @param msgType type of the message @type int, QtMsgType - @param args message handler arguments, for PyQt4 message to be shown, for - PyQt5 context information and message to be shown - @type PyQt4: bytes; PyQt5: tuple of (QMessageLogContext, bytes) + @param context context information + @type QMessageLogContext + @param message message to be shown + @type bytes """ - if len(args) == 2: - context = args[0] - message = args[1] - else: - message = args[0] if _msgHandlerDialog: try: if msgType == QtDebugMsg: @@ -130,7 +126,7 @@ message = message.replace("\r\n", "<br/>")\ .replace("\n", "<br/>")\ .replace("\r", "<br/>") - if len(args) == 2 and context.file is not None: + if context.file is not None: msg = "<p><b>{0}</b></p><p>{1}</p><p>File: {2}</p>" \ "<p>Line: {3}</p><p>Function: {4}</p>".format( messageType, Utilities.html_uencode(message), @@ -163,12 +159,9 @@ messageType = "Fatal Error" if isinstance(message, bytes): message = message.decode() - if len(args) == 2: - print("{0}: {1} in {2} at line {3} ({4})".format( - messageType, message, context.file, context.line, - context.function)) - else: - print("{0}: {1}".format(messageType, message)) + print("{0}: {1} in {2} at line {3} ({4})".format( + messageType, message, context.file, context.line, + context.function)) def qtHandler():