Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
852ba7eb
Commit
852ba7eb
authored
Mar 30, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #672053: Return a result from Py_Main, instead of exiting.
parent
e98922fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Modules/main.c
Modules/main.c
+9
-9
No files found.
Modules/main.c
View file @
852ba7eb
...
...
@@ -88,7 +88,7 @@ PYTHONCASEOK : ignore case in 'import' statements (Windows).\n\
"
;
static
void
static
int
usage
(
int
exitcode
,
char
*
program
)
{
FILE
*
f
=
exitcode
?
stderr
:
stdout
;
...
...
@@ -105,14 +105,14 @@ usage(int exitcode, char* program)
#if defined(__VMS)
if
(
exitcode
==
0
)
{
/* suppress 'error' message */
exit
(
1
)
;
return
1
;
}
else
{
/* STS$M_INHIB_MSG + SS$_ABORT */
exit
(
0x1000002c
)
;
return
0x1000002c
;
}
#else
exit
(
exitcode
)
;
return
exitcode
;
#endif
/*NOTREACHED*/
}
...
...
@@ -194,7 +194,7 @@ Py_Main(int argc, char **argv)
fprintf
(
stderr
,
"-Q option should be `-Qold', "
"`-Qwarn', `-Qwarnall', or `-Qnew' only
\n
"
);
usage
(
2
,
argv
[
0
]);
return
usage
(
2
,
argv
[
0
]);
/* NOTREACHED */
case
'i'
:
...
...
@@ -255,18 +255,18 @@ Py_Main(int argc, char **argv)
/* This space reserved for other options */
default:
usage
(
2
,
argv
[
0
]);
return
usage
(
2
,
argv
[
0
]);
/*NOTREACHED*/
}
}
if
(
help
)
usage
(
0
,
argv
[
0
]);
return
usage
(
0
,
argv
[
0
]);
if
(
version
)
{
fprintf
(
stderr
,
"Python %s
\n
"
,
PY_VERSION
);
exit
(
0
)
;
return
0
;
}
if
(
!
saw_inspect_flag
&&
...
...
@@ -291,7 +291,7 @@ Py_Main(int argc, char **argv)
if
((
fp
=
fopen
(
filename
,
"r"
))
==
NULL
)
{
fprintf
(
stderr
,
"%s: can't open file '%s'
\n
"
,
argv
[
0
],
filename
);
exit
(
2
)
;
return
2
;
}
else
if
(
skipfirstline
)
{
int
ch
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment