OK - I've broken it down to its simplest form. It looks like there's a problem importing the minidom class.<br><br>If you create a module TestModule.py containing the following code:<br><br>Python Code<br>==========<br>import 
xml.dom.minidom<br><br>class TestClass:<br>&nbsp;&nbsp;&nbsp; pass<br><br><br>and then try to import this class you will see this error.<br><br>My C# code is as follows:<br>====================<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PythonEngine engine = new PythonEngine();
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; engine.AddToPath(&quot;C:\\Python24\\lib&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; engine.AddToPath(&quot;C:\\Temp\\IronPythonTest\\IronPythonTest\\Python\\&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; engine.Execute(&quot;from TestModule import TestClass&quot;);
<br><br><br>Mike<br><br><br><div><span class="gmail_quote">On 7/13/06, <b class="gmail_sendername">Martin Maly</b> &lt;<a href="mailto:Martin.Maly@microsoft.com">Martin.Maly@microsoft.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">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.</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">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.</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">M.</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<div>

<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">

<hr align="center" size="2" width="100%">

</span></font></div>

<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
<a href="mailto:users-bounces@lists.ironpython.com" title="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-bounces@lists.ironpython.com</a> [mailto:
<a href="mailto:users-bounces@lists.ironpython.com" title="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-bounces@lists.ironpython.com</a>] <b><span style="font-weight: bold;">
On Behalf Of </span></b>Martin Maly<br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday, July 13, 2006 8:09
AM<br>
<b><span style="font-weight: bold;">To:</span></b> Discussion of IronPython<br>
<b><span style="font-weight: bold;">Subject:</span></b> Re: [IronPython] Unable
to cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'</span></font></p>

</div></div><div><span class="e" id="q_10c687b69844715c_1">

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">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.</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Thanks</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Martin</span></font></p>

<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>

<div>

<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">

<hr align="center" size="2" width="100%">

</span></font></div>

<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;">
<a href="mailto:users-bounces@lists.ironpython.com" title="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-bounces@lists.ironpython.com</a> [mailto:
<a href="mailto:users-bounces@lists.ironpython.com" title="mailto:users-bounces@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-bounces@lists.ironpython.com</a>] <b><span style="font-weight: bold;">
On Behalf Of </span></b>Mike Raath<br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday, July 13, 2006 1:41
AM<br>
<b><span style="font-weight: bold;">To:</span></b> Discussion of IronPython<br>
<b><span style="font-weight: bold;">Subject:</span></b> [IronPython] Unable to
cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'</span></font></p>

</div>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">&nbsp;</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Hi<br>
<br>
Having tried to switch over to beta 9, and changing my generic
Evaluate&lt;T&gt; references to EvaluateAs&lt;T&gt;, 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 <br>
engine.Execute(&quot;from Module import Class);<br>
<br>
The Module and Class definitions are custom - and as i say this statement works
under beta 8.<br>
<br>
Do you require more information or do I need to make a further change to my
code to get it to work? <br>
<br>
Thanks,<br>
Mike</span></font></p>

</span></div><div></div>

</div>



</div><br>_______________________________________________<br>users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:users@lists.ironpython.com">users@lists.ironpython.com</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br><br><br></blockquote></div><br>