[IronPython] IronPython 2.0 Errors...

Michael Foord fuzzyman at voidspace.org.uk
Tue Jan 27 00:08:06 CET 2009


Howland-Rose, Kyle wrote:
> Hi Antonio,
> Have you tried http://pychecker.sourceforge.net/?
> PyChecker attempts to report what would be compiler errors in compiled 
> languages. I don't know whether it works with IronPython.
>

PyLint works without having to import the code - so even though you run 
it under CPython it on IronPython code.

http://www.logilab.org/project/pylint

Another possibility is pyflakes which has the advantage of being very fast.

http://divmod.org/trac/wiki/DivmodPyflakes

Michael

> Kyle
>
> ------------------------------------------------------------------------
> *From:* users-bounces at lists.ironpython.com 
> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *António Piteira
> *Sent:* Saturday, 24 January 2009 4:14 AM
> *To:* users at lists.ironpython.com
> *Subject:* Re: [IronPython] IronPython 2.0 Errors...
>
> I get it, I’m not really surprised… I was hoping that maybe there was 
> a way to use scriptSource.Compile(options,errorTracker), or something 
> like that, and get the errors from errorTracker or some kind of sink.
>
> Very much apreciated for your time.
>
> ­­­­­­­­­­­­­­­­­­___________________________________________________________________________________________________________________
>
> Are you familiar with "the halting problem"? :) 
> (http://en.wikipedia.org/wiki/Halting_problem) 
> <http://en.wikipedia.org/wiki/Halting_problem>
>
> 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:
>
> import sys
>
> sys.modules['foo'] = type(sys)('foo')
>
> import foo
>
> Your static analyzer would have a tough time recognizing that this 
> program would not raise a runtime error.
>
> ­­­­­­­­­­­­­­­­­­___________________________________________________________________________________________________________________
>
> Those things are run-time errors (failed imports et al). You would
>
> possibly look at the parse tree for any imports and determine if the
>
> modules to be imported exist, but that sounds like a lot of trouble :)
>
> slide
>
> ­­­­­­­­­­­­­­­­­­___________________________________________________________________________________________________________________
>
> On Fri, Jan 23, 2009 at 8:45 AM, António Piteira 
> <antonio.piteira at wtvision.com <mailto:antonio.piteira at wtvision.com>> 
> wrote:
>
> Hi,
>
> 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.
>
> Is there any way to do this?
>
> Thanks,
>
> Vision
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
> ************************************************************************
>
> Allens Arthur Robinson online: http://www.aar.com.au
>
> This email is confidential and may be subject to legal or other 
> professional privilege. It is also subject to copyright. If you have 
> received it in error, confidentiality and privilege are not waived and 
> you must not disclose or use the information in it. Please notify the 
> sender by return email and delete it from your system. Any personal 
> information in this email must be handled in accordance with the 
> Privacy Act 1988 (Cth).
>
> *************************************************************************
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list