[IronPython] Sys.exit request

Dino Viehland dinov at exchange.microsoft.com
Tue Nov 14 00:47:27 CET 2006


There's a int GetExitCode(out object nonIntegerCode) API on PythonSystemExitException that will return you the integer exit code or a Python object if the user did sys.exit('foo') or something easily insane.  In that what you're looking for?

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paul Moore
Sent: Monday, November 13, 2006 3:38 PM
To: Discussion of IronPython
Subject: [IronPython] Sys.exit request

I did ask before but I guess it got lost.

Can the PythonSystemExitException please have the parameter passed to
exit in it

So if I do

exit(12)

Then I can do

Catch(PythonSystemExitException ex)
{
        if((int)ex.ExitCode == 12)
                .......
}
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list