Showing with 5 additions and 2 deletions.
  1. +1 −1 debian/rules
  2. +4 −1 python/utils.py
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ binary-arch: build install
install -o root -g root -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis-plugin-grass/usr/bin/qgis
install -o root -g root -m 755 $(CURDIR)/debian/qgis.sh $(CURDIR)/debian/qgis-plugin-grass/usr/bin/qbrowser

ifneq (,$(findstring $(DISTRIBUTION),"wheezy sid"))
ifneq (,$(findstring $(DISTRIBUTION),"wheezy sid quantal raring"))
dh_python2 --no-guessing-versions
else
dh_pycentral
Expand Down
5 changes: 4 additions & 1 deletion python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@
warnings.filterwarnings("ignore", "the sets module is deprecated")

def showWarning(message, category, filename, lineno, file=None, line=None):
stk = ""
for s in traceback.format_stack()[:-2]:
stk += s.decode('utf-8', 'replace')
QgsMessageLog.logMessage(
warnings.formatwarning(message, category, filename, lineno),
"warning:%s\ntraceback:%s" % ( warnings.formatwarning(message, category, filename, lineno), stk),
QCoreApplication.translate( "Python", "Python" )
)
warnings.showwarning = showWarning
Expand Down