Hello everybody,

In the following code of the finish() function, is there any way to
get the exit code passed to sys.exit() ?

def finish() :
   RETURN_CODE_FROM_SYS_EXIT = ????    # how can I get it ?
   if RETURN_CODE_FROM_SYS_EXIT = 0 :
     # process ended OK
   else :
     # process ended with some error
     # execute something

atexit.register(finish)

# this is my main program....

ERR_CODE=3
sys.exit(ERR_CODE)


Regards,

Yujo

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to