Kaydet (Commit) 90cf3072 authored tarafından Enrico Tröger's avatar Enrico Tröger

Adjust error line parsing for newer Python versions

The format of the error message output of the py_compile module has changed in
Python 2.6. The code now tries to detect the format and parse it accordingly.
üst cf88abfe
...@@ -844,11 +844,25 @@ static void parse_compiler_error_line(const gchar *string, ...@@ -844,11 +844,25 @@ static void parse_compiler_error_line(const gchar *string,
case GEANY_FILETYPES_PYTHON: case GEANY_FILETYPES_PYTHON:
{ {
/* File "HyperArch.py", line 37, in ? /* File "HyperArch.py", line 37, in ?
* (file "clrdial.tcl" line 12) */ * (file "clrdial.tcl" line 12)
data.pattern = " \""; * */
data.min_fields = 6; if (strstr(string, " line ") != NULL)
data.line_idx = 5; {
data.file_idx = 2; /* Tcl and old Python format (<= Python 2.5) */
data.pattern = " \"";
data.min_fields = 6;
data.line_idx = 5;
data.file_idx = 2;
}
else
{
/* SyntaxError: ('invalid syntax', ('sender.py', 149, 20, ' ...'))
* (used since Python 2.6) */
data.pattern = ",'";
data.min_fields = 8;
data.line_idx = 6;
data.file_idx = 4;
}
break; break;
} }
case GEANY_FILETYPES_BASIC: case GEANY_FILETYPES_BASIC:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment