1.1 --- a/python.source/src/org/netbeans/modules/python/source/PythonParser.java Sun Jun 25 18:25:05 2017 +0200
1.2 +++ b/python.source/src/org/netbeans/modules/python/source/PythonParser.java Tue Jun 27 21:26:18 2017 +0200
1.3 @@ -73,6 +73,7 @@
1.4 import org.python.antlr.base.stmt;
1.5 import org.python.antlr.runtime.ANTLRReaderStream;
1.6 import org.python.antlr.runtime.CharStream;
1.7 +import org.python.core.PyException;
1.8
1.9 /**
1.10 * Parser for Python. Wraps Jython.
1.11 @@ -374,6 +375,11 @@
1.12 } else {
1.13 return sanitize(context, sanitizing);
1.14 }
1.15 +
1.16 + } catch (PyException e) {
1.17 + // This is issue 251705
1.18 + Logger.getLogger(this.getClass().getName()).log(Level.WARNING, e.getMessage());
1.19 + return new PythonParserResult(null, context.snapshot);
1.20 } catch (IllegalArgumentException e) {
1.21 Logger.getLogger(this.getClass().getName()).log(Level.WARNING, e.getMessage());
1.22 return new PythonParserResult(null, context.snapshot);