[IronPython] Syntax Error (or not)

Michael Foord fuzzyman at voidspace.org.uk
Mon Apr 7 23:15:36 CEST 2008


Difference in handling of an incomplete statement at the interactive 
interpreter (I think this is biting me as I implement an interactive 
interpreter in the browser and I *think* it is unrelated to previous 
related bugs we have discussed!).

The first (incomplete) statement should raise a SyntaxError immediately:

C:\Users\Administrator>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit 
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> os.
  File "<stdin>", line 1
    os.
      ^
SyntaxError: invalid syntax
 >>>

C:\Users\Administrator>e:\Dev\ironpython2\ipy.exe
IronPython 2.0 Beta (2.0.0.1000) on .NET 2.0.50727.1434
Copyright (c) Microsoft Corporation. All rights reserved.
 >>> os.
... ss
  File "", line 1
    os.
       ^
SyntaxError: unexpected token '<newline>'

 >>>

Michael Foord
http://www.ironpythoninaction.com/



More information about the Ironpython-users mailing list