[Patches] [ python-Patches-672053 ] Py_Main() removal of exit() calls. Return value instead

SourceForge.net noreply@sourceforge.net
Sun, 30 Mar 2003 09:24:17 -0800


Patches item #672053, was opened at 2003-01-21 22:11
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=672053&group_id=5470

Category: Modules
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Douglas Napoleone (derivin)
Assigned to: Nobody/Anonymous (nobody)
Summary: Py_Main() removal of exit() calls. Return value instead

Initial Comment:
Py_Main() does not perform to spec.
The C/API documentation notes that the function will 
return a value of 2 for imporper commandline values.
Instead it calls exit()

calling exit() in general is bad. The caller should be the 
one to call exit or return from main() with the supplied 
exit code.

this is particularly troublesome when there are end 
cleanup calls that need to be made before terminating 
the program and static destruction is not an option.

The patch just replaces the exit calls with a return.
Calls to usage() have their return value returned.

very streight forward



----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-03-30 19:24

Message:
Logged In: YES 
user_id=21627

Thanks for the patch. Applied as main.c 1.77.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=672053&group_id=5470