--- a/Modules/main.c +++ b/Modules/main.c @@ -487,10 +487,6 @@ Py_InspectFlag = 0; /* do exit on SystemExit */ int exitcode; - if (pymain_run_startup(config, &exitcode)) { - return exitcode; - } - if (pymain_run_interactive_hook(&exitcode)) { return exitcode; } @@ -588,6 +584,10 @@ pymain_header(config); + if (pymain_run_startup(config, exitcode)) { + return; + } + if (config->run_command) { *exitcode = pymain_run_command(config->run_command); } --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -108,7 +108,7 @@ /* Envvars that don't have equivalent command-line options are listed first */ static const char usage_envvars[] = "Environment variables that change behavior:\n" -"PYTHONSTARTUP : file executed on interactive startup (no default)\n" +"PYTHONSTARTUP : file executed on Python startup\n" "PYTHONPATH : '%lc'-separated list of directories prefixed to the\n" " default module search path. The result is sys.path.\n" "PYTHONHOME : alternate directory (or %lc).\n"