I just noticed that in 2.5.0 if I accidently make a syntax error when defining a new function using the interactive shell it appears to stop executing any commands I type in. Below are two sessions where I typed the same text but got very different results.


2.2.1 Flagged the second print statement as a syntax error, but further input typed in is handled and processed correctly.


2.5.0 Does not flag any errors, but I can no longer get anything to be processed. It keeps accepting input, but does not execute it.


It looks like down somewhere in InteractiveInterpreter or lower the runsource() java method keeps returning ‘true’ as if it needs more input. I am actually trying to use Jython inside my application via a simple GUI, but since the problem happens with the jython.bat that ships with 2.5.0 I cannot proceed with my work.


Any ideas? Workarounds?




Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26)

[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_13

Type "help", "copyright", "credits" or "license" for more information.

>>> def x():

...   print 'aaa'

... print 'bbb'


... print 1111


... print 2222






Jython 2.2.1 on java1.6.0_13

Type "copyright", "credits" or "license" for more information.

>>> def x():

...   print 'aaa'

... print 'bbb'

Traceback (innermost last):

  (no code object) at line 0

  File "<console>", line 3

        print 'bbb'


SyntaxError: invalid syntax

>>> print 1111



>>> print 2222




Joey Jarosz

Senior Architect

Chip Planning Solutions

Cadence Design Systems, Inc.
(408) 914-6269

Need some IP? Check out www.chipestimate.com