[IronPython] IronPython 1.0 Beta 3 on Mono

Michael Twomey micktwomey at gmail.com
Thu Feb 16 17:39:07 CET 2006


On 16/02/06, Sanghyeon Seo <sanxiyn at gmail.com> wrote:
> You will get a lot of warnings. A topic for another mail... Anyway,
> you should see "Compilation succeeded" message.
>
> Resulting binary can be run with both current Mono release and Mono SVN trunk.
>

Good stuff, I'm pretty eager to get IronPython working on my powerbook

> There's another simple workaround for this though. Add this to site.py:
>
> # A hack for Mono
> try:
>     import time
> except:
>     pass
>
> Importing time *the second time* will succeed. Don't ask me why.
>

I suspect this is due to a bug in module loading which afflicted
cpython too (fixed in 2.4). When you import a module for the first
time python tries to initialize the module and load it. If it fails
python should throw away the broken module but this bug means that the
old junk is left over. So when you try to import for the second time
you are getting the broken time module (but no import errors). This
can lead to some very strange errors.

cheers,
  Michael


More information about the Ironpython-users mailing list