File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -87,17 +87,17 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
87
87
runString (
88
88
" def qgis_except_hook_msg(type, value, tb, msg):\n "
89
89
" lst = traceback.format_exception(type, value, tb)\n "
90
- " if msg == None: msg = '" + QObject::tr ( " An error has occured while executing Python code:" ) + " '\n "
90
+ " if msg == None: msg = '" + QObject::tr ( " An error has occured while executing Python code:" ). replace ( " ' " , " \\ ' " ) + " '\n "
91
91
" txt = '<font color=\" red\" >'+msg+'</font><br><br>'\n "
92
92
" for s in lst:\n "
93
93
" txt += s\n "
94
- " txt += '<br>" + QObject::tr ( " Python version:" ) + " <br>' + sys.version + '<br><br>'\n "
95
- " txt += '" + QObject::tr ( " Python path:" ) + " ' + str(sys.path)\n "
94
+ " txt += '<br>" + QObject::tr ( " Python version:" ). replace ( " ' " , " \\ ' " ) + " <br>' + sys.version + '<br><br>'\n "
95
+ " txt += '" + QObject::tr ( " Python path:" ). replace ( " ' " , " \\ ' " ) + " ' + str(sys.path)\n "
96
96
" txt = txt.replace('\\ n', '<br>')\n "
97
97
" txt = txt.replace(' ', ' ')\n " // preserve whitespaces for nicer output
98
98
" \n "
99
99
" msg = QgsMessageOutput.createMessageOutput()\n "
100
- " msg.setTitle('" + QObject::tr ( " Python error" ) + " ')\n "
100
+ " msg.setTitle('" + QObject::tr ( " Python error" ). replace ( " ' " , " \\ ' " ) + " ')\n "
101
101
" msg.setMessage(txt, QgsMessageOutput.MessageHtml)\n "
102
102
" msg.showMessage()\n " );
103
103
runString (
You can’t perform that action at this time.
0 commit comments