[IronPython] [Simpy-users] Simpy under IronPython 0.96

Stanislas Pinte stan at phidani.be
Fri Dec 16 17:40:34 CET 2005


I think I have the first idea why the tests are failing:

[bin]> ./IronPythonConsole.exe
IronPython 0.9.6 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> def testgenerator():
..     for i in range(0,10):
..             yield i
..
>>> testgenerator
<function testgenerator at 0x000000000000002B>
>>> type(testgenerator)
<type 'function'>
>>> import types
>>> type(testgenerator) == types.GeneratorType
False
>>>

--> The problem is that the following code doesn't work with either IronPythonConsole, or standard
CPython 2.4.

Any idea what I may be missing?

Thanks,

Stan.

> I propose we look at the tests one-by-one, and try to solve the problems.
> 
> First failed test:
> 
> def testActivate(self):
>         """Test activate()
>         """
>         P1 = P(name="P1",T=100.0)
>         initialize()
>         activate(P1,P1.execute(),0)
>         simulate(until=5)
>         assert(now()==5),"Simulate stopped at %s not %s"%(now(),5)
> 
> ERROR: Test activate()
> ----------------------------------------------------------------------
> <class 'SimPy.Simulation.Simerror'>: "Fatal SimPy error: activating function whi
> ch is not a generator (contains no 'yield')"
> 

------------------------------------ 






More information about the Ironpython-users mailing list