Skip to content

Commit 2819668

Browse files
committed
Show Python error stack trace when in blocking dialog
1 parent e263e9e commit 2819668

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎python/utils.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"""
3030

3131
from PyQt4.QtCore import QCoreApplication, QLocale
32-
from PyQt4.QtGui import QPushButton
32+
from PyQt4.QtGui import QPushButton, QApplication
3333
from qgis.core import QGis, QgsExpression, QgsMessageLog, qgsfunction, QgsMessageOutput
3434
from qgis.gui import QgsMessageBar
3535

@@ -74,7 +74,9 @@ def showException(type, value, tb, msg, messagebar=False):
7474
title = QCoreApplication.translate('Python', 'Python error')
7575
QgsMessageLog.logMessage(logmessage, title)
7676

77-
if messagebar and iface:
77+
blockingdialog = QApplication.instance().activeModalWidget()
78+
79+
if messagebar and iface and not blockingdialog:
7880
item = iface.messageBar().currentItem()
7981
if item and item.property("Error") == msg:
8082
# Return of we already have a message with the same error message

0 commit comments

Comments
 (0)