On 8/14/2010 4:05 PM, bvdp wrote:
Assuming I have a module 'foo.py' with something like this:

def error(s):
     print "Error", s
     sys.exit(1)

def func(s):
     ... do some processing
     ... call error() if bad .. go to system exit.
     ...  more processing

   Fix "func".  That's terrible Python.   No standard Python library
module calls system exit to handle an error.  So that must be in
your code.   Standard procedure for errors is to raise an
exception.
                        
                                John Nagle
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to