<div dir="ltr">Don'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"><<a href="mailto:antonio.piteira@wtvision.com">antonio.piteira@wtvision.com</a>></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:"Courier New"">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:"Courier New"">errorTracker </span><span lang="EN-US">or some kind of sink.</span></p>
<p><span lang="EN-US"> </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"> </span></p>
<p><span style="color:black">___________________________________________________________________________________________________________________</span></p><div class="Ih2E3d">
<div>
<p><span lang="EN-US" style="color:black"> </span></p>
<p><span lang="EN-US" style="color:black"> </span></p>
<p><span lang="EN-US">Are you familiar with "the halting
problem"? :) (</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"> </span></p>
</div>
<div>
<p>The only reliable way to find if a particular program
returns a runtime error is to execute the program. 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 that tricks your
analyzer into reporting a problem where none exists. Consider this:</p>
</div>
<div>
<p> </p>
</div>
<div>
<p>import sys</p>
</div>
<div>
<p>sys.modules['foo'] = type(sys)('foo')</p>
</div>
<div>
<p>import foo</p>
</div>
<div>
<p> </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"> </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"> </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"> </span></p>
<p>slide</p>
</div><p><span style="color:black">___________________________________________________________________________________________________________________</span></p><div class="Ih2E3d">
<p><span style="color:black"> </span></p>
<p><span style="color:black"> </span></p>
<div>
<p>On Fri, Jan 23, 2009 at 8:45 AM, António Piteira <<a href="mailto:antonio.piteira@wtvision.com" target="_blank">antonio.piteira@wtvision.com</a>>
wrote:</p>
<div>
<div>
<p><span lang="EN-US" style="color:black">Hi,</span></p>
<p><span lang="EN-US" style="color:black"> </span></p>
<p><span lang="EN-US" style="color:black">I'm trying get all runtime errors
without actually executing the code. I can get all syntax errors using the
parser, but runtime errors like "import ys" and stuff like that I',
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"> </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> </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>