C
carl.dhalluin
Hi,
I am playing with the atexit module but I don't find a way to see the
difference
between a script calling sys.exit(<returncode>) and the interpreting
arriving at the end
of the source code file. This has a semantic difference for my
applications.
Is there a way to determine in an exithandler (that is registered
using atexit.register)
how I exited?
Second question: is there a way to determine in my exithandler what
the return code was.
atexit doesn't seem to support that
Third question: I can solve part of my problem by reassigning sys.exit
= myfunction
Is that a wise idea? It seems that an interpreter (python 2.4)
reaching end of source code, calls sys.exitfunc instead of sys.exit ?
Thanks
Carl D'Halluin
www.qlayer.com
I am playing with the atexit module but I don't find a way to see the
difference
between a script calling sys.exit(<returncode>) and the interpreting
arriving at the end
of the source code file. This has a semantic difference for my
applications.
Is there a way to determine in an exithandler (that is registered
using atexit.register)
how I exited?
Second question: is there a way to determine in my exithandler what
the return code was.
atexit doesn't seem to support that
Third question: I can solve part of my problem by reassigning sys.exit
= myfunction
Is that a wise idea? It seems that an interpreter (python 2.4)
reaching end of source code, calls sys.exitfunc instead of sys.exit ?
Thanks
Carl D'Halluin
www.qlayer.com