[IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType'

Martin Maly Martin.Maly at microsoft.com
Thu Jul 13 17:18:52 CEST 2006


However, that said, in Beta 9, the OldClass is no longer a DynamicType, which explains the exception itself. To find out what you need to change in your code is something that we'll need more info for.

For example, the exception can come from anywhere in the Module body (during import, the module body gets executed - unless the module has been already imported). Since I don't get exception when executing "from Module import Class", I suspect that this is what may be the case. The call stack for the exception could help find out what line in your module code is throwing.

M.

________________________________
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly
Sent: Thursday, July 13, 2006 8:09 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType'

To help you, we will need more information about your use of the Python Engine. The simple case of executing "from Module import Class" does work so we need to know more to find out what the problem may be.

Thanks
Martin

________________________________
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Raath
Sent: Thursday, July 13, 2006 1:41 AM
To: Discussion of IronPython
Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType'

Hi

Having tried to switch over to beta 9, and changing my generic Evaluate<T> references to EvaluateAs<T>, I get a runtime error on an import statement which works under beta 8. The exception is as is detailed in the message above, and is from a statement like
engine.Execute("from Module import Class);

The Module and Class definitions are custom - and as i say this statement works under beta 8.

Do you require more information or do I need to make a further change to my code to get it to work?

Thanks,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060713/2b7b2fec/attachment.html>


More information about the Ironpython-users mailing list