Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e98922f

Browse files
committed
Patch #695250: Suppress COPYRIGHT if site.py is not read. Fixes #672614.
Will backport to 2.2.
1 parent 24b8881 commit e98922f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Modules/main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,12 @@ Py_Main(int argc, char **argv)
370370
Py_Initialize();
371371

372372
if (Py_VerboseFlag ||
373-
(command == NULL && filename == NULL && stdin_is_interactive))
374-
fprintf(stderr, "Python %s on %s\n%s\n",
375-
Py_GetVersion(), Py_GetPlatform(), COPYRIGHT);
373+
(command == NULL && filename == NULL && stdin_is_interactive)) {
374+
fprintf(stderr, "Python %s on %s\n",
375+
Py_GetVersion(), Py_GetPlatform());
376+
if (!Py_NoSiteFlag)
377+
fprintf(stderr, "%s\n", COPYRIGHT);
378+
}
376379

377380
if (command != NULL) {
378381
/* Backup _PyOS_optind and force sys.argv[0] = '-c' */

0 commit comments

Comments
 (0)