From: Steve C. <St...@ig...> - 2002-02-21 14:57:48
|
I believe this was a known issue. I submitted a patch last month to ReadlineConsole.java that you might want to get from CVS and rebuild with. Are you using the GNU Readline or the Editline flavor of readline? -----Original Message----- From: Stefan [mailto:sd...@or...] Sent: Thursday, February 21, 2002 5:48 AM To: jyt...@li... Cc: Brian Ericson Subject: Re: [Jython-users] Jython, readline, and : On Wed, 20 Feb 2002 12:15:11 -0600 Brian Ericson <bm...@vi...> wrote: > Anyone tried ":" (compound statements) with Bablok's readline (version > 0.7.0 on Linux)? Esc-Tab over Tab will take a little getting used to=20 > (especially since Tab itself in readline isn't all that useful), but=20 > readline apparently doesn't like the last blank line needed to terminate=20 > the statement... >=20 > >>> if 1: > ... print 1 > ... > Traceback (innermost last): > (no code object) at line 0 > File "<console>", line 3 > null > ^ > SyntaxError: invalid syntax > >>> >=20 > Is this a known issue? Is there a workaround? I don't want to go back... >=20 >=20 Hi, I got the same annoying error using the readline library. I patched the ReadlineConsole.java which comes with the lib (contrib) as follows to get around. (Beside this, the library is rellay great!) /** * Write a prompt and read a line. * * The returned line does not include the trailing newline. When the * user enters the EOF key sequence, EOFError is raised. * * This subclass implements the functionality using JavaReadline. **/ 35 public String raw_input(PyObject prompt) { 36 try { 37 String line =3D Readline.readline(prompt.toString()); 38 return (line =3D=3D null ? "" : line); 39 } catch (java.io.EOFException eofe) { 40 throw new PyException(Py.EOFError); 41 } catch (java.io.UnsupportedEncodingException e) { 42 throw new PyException(); 43 } 44 } Note the differences at lines 37,38 It works for me. Hope this helps. --Stefan > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users >=20 _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users |