-X:Python26 was removed before 2.6A1 was shipped.  This should work "out of the 
box" with 2.6A1:
    C:\Users\dfugate.REDMOND>"C:\Program Files\IronPython 2.6\ipy.exe"
    IronPython 2.6 Alpha 1 (2.6.0.1) on .NET 2.0.50727.3053
    Type "help", "copyright", "credits" or "license" for more information.
    >>> with file("test.log", "w") as f:
    ...     pass
    ...
    >>> ^Z

    C:\Users\dfugate.REDMOND>"C:\Program Files\IronPython 2.6\ipy.exe"
    IronPython 2.6 Alpha 1 (2.6.0.1) on .NET 2.0.50727.3053
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from __future__ import with_statement
    >>> ^Z

Elise, can you give a few more details about your setup?  Are you running an 
IronPython that was installed via IronPython.msi or are you using the zip file 
full of binaries directly?  Also, are you utilizing ipy.exe or perhaps using 
the DLR to host Python from C#?  Last but not least, what does %PYTHONPATH% 
look like on your machine?

From: [email protected] 
[mailto:[email protected]] On Behalf Of Dino Viehland
Sent: Tuesday, May 19, 2009 8:10 AM
To: Discussion of IronPython
Subject: Re: [IronPython] with_statement in IronPython 2.6 Alpha

I think you need to pass the -X:Python26 command line option in the alpha to 
enable this.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Elise Langham (Elanit)
Sent: Tuesday, May 19, 2009 6:29 AM
To: [email protected]
Subject: [IronPython] with_statement in IronPython 2.6 Alpha

Can anyone explain to me how to use the with_statement in IronPython 2.6 ?
It is totally unrecognised as a keyword

I've tried the Iron Python 2.5 solution:

from __future__ import with_statement  which gives the error future feature is 
not defined:with_statement

can anyone help me ?

thanks,

  Elise
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to