Python Code Auditing Tool

Paul Rubin http
Wed Feb 2 00:52:28 EST 2005


Robey Holderith <robey at flaminglunchbox.net> writes:
> Does anybody know of a tool that can tell me all possible exceptions that
> might occur in each line of code?  What I'm hoping to find is something
> like the following:

That is impossible.  The parameter to the raise statement is a class
object, which can be anything.  I.e. you could say:

   class ex1: pass
   class ex2: pass

   if something(): my_ex = ex1
   else: my_ex = ex2

   raise my_ex    # static tool can't know what exception gets raised here.



More information about the Python-list mailing list