From: <to...@gn...> - 2001-11-01 16:11:50
|
Hi, that's me again, problem with exception again :-) Now I am able to catch SyntaxError exception from PythonInterpreter. But = I would like to get direct from this exception instance another = information like LINE, COLUMN of syntax error. Is there other possibility to get these datas except manually PARSING of = VALUE or TYPE data fields. Thanks, Vaclav Tolar |
From: Samuele P. <ped...@bl...> - 2001-11-01 17:01:12
|
Hi. What do you mean by PARSING? PythonInterpreter interp =3D new PythonInterpreter(); try { interp.execfile("test"); } catch(Exception e) { if(e instanceof PyException) { if(Py.matchException((PyException)e,Py.SyntaxError)) { PyObject syn =3D ((PyException)e).value; System.out.println("syn-line:"+syn.__findattr__("lineno= ")); System.out.println("syn-col:"+syn.__findattr__("offset"= )); } // other Jython excs } // other Java excs } regards, Samuele Pedroni. ----- Original Message ----- From: V=E1clav Tolar To: Jyt...@li... Sent: Thursday, November 01, 2001 5:08 PM Subject: [Jython-users] SyntaxError exception again Hi, that's me again, problem with exception again :-) Now I am able to catch SyntaxError exception from PythonInterpreter. But = I would like to get direct from this exception instance another information= like LINE, COLUMN of syntax error. Is there other possibility to get these datas except manually PARSING of = VALUE or TYPE data fields. Thanks, Vaclav Tolar |