<div dir="ltr">Don&#39;t you think PythonException or related classes would be sufficient?<br><br><div class="gmail_quote">On Fri, Jan 23, 2009 at 7:14 PM, António Piteira <span dir="ltr">&lt;<a href="mailto:antonio.piteira@wtvision.com">antonio.piteira@wtvision.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">








<div lang="PT" link="blue" vlink="purple">

<div>

<p><span lang="EN-US" style="color:black">I get it, I'm not
really surprised… I was hoping that maybe there was a way to use </span><span lang="EN-US">s</span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">criptSource.Compile(options,errorTracker),
</span><span lang="EN-US">or something like that, and get the errors from </span><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">errorTracker </span><span lang="EN-US">or some kind of sink.</span></p>


<p><span lang="EN-US">&nbsp;</span></p>

<p><span lang="EN-US">Very much apreciated for your time.</span><span lang="EN-US"></span></p>

<p><span lang="EN-US" style="color:black">&nbsp;</span></p>

<p><span style="color:black">­­­­­­­­­­­­­­­­­­___________________________________________________________________________________________________________________</span></p><div class="Ih2E3d">

<div>

<p><span lang="EN-US" style="color:black">&nbsp;</span></p>

<p><span lang="EN-US" style="color:black">&nbsp;</span></p>

<p><span lang="EN-US">Are you familiar with &quot;the halting
problem&quot;? :) (</span><a href="http://en.wikipedia.org/wiki/Halting_problem" target="_blank"><span lang="EN-US">http://en.wikipedia.org/wiki/Halting_problem)</span></a><span lang="EN-US"></span></p>

</div>

<div>

<p><span lang="EN-US">&nbsp;</span></p>

</div>

<div>

<p>The only reliable way to find if a particular program
returns a runtime error is to execute the program. &nbsp;For limited, targeted
cases, (such as importing modules) you could write an analyzer program which
would be *often* right -- but I could create a program &nbsp;that tricks your
analyzer into reporting a problem where none exists. &nbsp;Consider this:</p>

</div>

<div>

<p>&nbsp;</p>

</div>

<div>

<p>import sys</p>

</div>

<div>

<p>sys.modules[&#39;foo&#39;] = type(sys)(&#39;foo&#39;)</p>

</div>

<div>

<p>import foo</p>

</div>

<div>

<p>&nbsp;</p>

</div>

<div>

<p>Your static analyzer would have a tough time recognizing
that this program would not raise a runtime error.</p>

</div>

<p><span style="color:black">&nbsp;</span></p>

</div><p><span lang="EN-US" style="color:black">­­­­­­­­­­­­­­­­­­___________________________________________________________________________________________________________________</span><span lang="EN-US"></span></p><div class="Ih2E3d">


<p><span lang="EN-US">&nbsp;</span></p>

<p><span lang="EN-US">Those things are run-time errors (failed
imports et al). You would</span></p>

<p><span lang="EN-US">possibly look at the parse tree for any
imports and determine if the</span></p>

<p><span lang="EN-US">modules to be imported exist, but that
sounds like a lot of trouble :)</span></p>

<p><span lang="EN-US">&nbsp;</span></p>

<p>slide</p>

</div><p><span style="color:black">­­­­­­­­­­­­­­­­­­___________________________________________________________________________________________________________________</span></p><div class="Ih2E3d">

<p><span style="color:black">&nbsp;</span></p>

<p><span style="color:black">&nbsp;</span></p>

<div>

<p>On Fri, Jan 23, 2009 at 8:45 AM, António Piteira &lt;<a href="mailto:antonio.piteira@wtvision.com" target="_blank">antonio.piteira@wtvision.com</a>&gt;
wrote:</p>

<div>

<div>

<p><span lang="EN-US" style="color:black">Hi,</span></p>

<p><span lang="EN-US" style="color:black">&nbsp;</span></p>

<p><span lang="EN-US" style="color:black">I&#39;m trying get all runtime errors
without actually executing the code. I can get all syntax errors using the
parser, but runtime errors like &quot;import ys&quot; and stuff like that I&#39;,
not able to.</span></p>

<p><span lang="EN-US" style="color:black">Is there any way to do this?</span></p>

<p><span lang="EN-US" style="color:black">&nbsp;</span></p>

<p><span lang="EN-US" style="color:black">Thanks,</span></p>

<p><span lang="EN-US" style="color:black">Vision</span></p>

</div>

</div>

<p style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a></p>

</div>

<p>&nbsp;</p>

</div></div>

</div>


<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://nomadlife.org">nomadlife.org</a><br><br>
</div>