◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
14 changes: 9 additions & 5 deletions Include/cpython/coreconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,15 @@ typedef struct {
always exists and is never empty. */
_PyWstrList argv;

/* Program: argv[0] or "".
Used to display Python usage if parsing command line arguments fails.
Used to initialize the default value of program_name */
wchar_t *program;
wchar_t *program_name; /* Program name, see also Py_GetProgramName() */

_PyWstrList xoptions; /* Command line -X options */
_PyWstrList warnoptions; /* Warnings options */
Expand Down
4 changes: 2 additions & 2 deletions Modules/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pymain_run_file(_PyCoreConfig *config, PyCompilerFlags *cf)
else
cfilename = "<unprintable file name>";
fprintf(stderr, "%ls: can't open file '%s': [Errno %d] %s\n",
config->program, cfilename, err, strerror(err));
PyMem_RawFree(cfilename_buffer);
return 2;
}
Expand All @@ -303,7 +303,7 @@ pymain_run_file(_PyCoreConfig *config, PyCompilerFlags *cf)
if (_Py_fstat_noraise(fileno(fp), &sb) == 0 && S_ISDIR(sb.st_mode)) {
fprintf(stderr,
"%ls: '%ls' is a directory, cannot continue\n",
config->program, filename);
fclose(fp);
return 1;
}
Toggle all file notes Toggle all file annotations