I am using 2.7.0 stand alone jar. Maven,

<dependency>
<groupId>org.python</groupId>
<artifactId>jython-standalone</artifactId>
<version>2.7.0</version>
</dependency>

I was using a different version of jython (2.5.3) when I posted that issue. The issue is still exist in 2.7.0 also.
Test cases,
Hope this may help you. 

You people had done a great job by implementing this tool. It's really magical.
  


Thanks & Regards,
Pradeep CH
+91-7708336299 

On Fri, Feb 24, 2017 at 2:08 AM, James Mudd <report@bugs.jython.org> wrote:

James Mudd added the comment:

Could you provide more details on which version of Jython does it fail?

I have just tried this on master and it appears to work almost correctly. Jython returns the correct SyntaxError, with a slightly different message to CPython and the ^ highlighting the position of the error is wrong.

Jython 2.7.1b3 (, Feb 23 2017, 20:19:21)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_121
Type "help", "copyright", "credits" or "license" for more information.
>>> print "some text
  File "<stdin>", line 1
    print "some text
    ^
SyntaxError: no viable alternative at input '<EOF>'
>>> print 'some text
  File "<stdin>", line 1
    print 'some text
    ^
SyntaxError: no viable alternative at input '<EOF>'
>>> print 'some data
  File "<stdin>", line 1
    print 'some data
    ^
SyntaxError: no viable alternative at input '<EOF>'
>>> exec('def foo():\n    return "bar\n')
>>> exec('a = "bar\n')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
    a = "bar
     ^
SyntaxError: no viable alternative at input '='
>>>

The only example which actually failed for me (by which I mean incorrectly suceeded) was "exec('def foo():\n    return "bar\n')" where no SyntaxError was raised. I will have a look at that one

----------
nosy: +jamesmudd

_______________________________________
Jython tracker <report@bugs.jython.org>
<http://bugs.jython.org/issue2466>
_______________________________________