@@ -269,7 +269,7 @@ pymain_run_command(wchar_t *command)
269
269
270
270
271
271
static int
272
- pymain_start_pyrepl (void )
272
+ pymain_start_pyrepl (int pythonstartup )
273
273
{
274
274
int res = 0 ;
275
275
PyObject * console = NULL ;
@@ -306,7 +306,7 @@ pymain_start_pyrepl(void)
306
306
goto done ;
307
307
}
308
308
if (!PyDict_SetItemString (kwargs , "mainmodule" , main_module )
309
- && !PyDict_SetItemString (kwargs , "pythonstartup" , _PyLong_GetOne () )) {
309
+ && !PyDict_SetItemString (kwargs , "pythonstartup" , pythonstartup ? Py_True : Py_False )) {
310
310
console_result = PyObject_Call (console , empty_tuple , kwargs );
311
311
if (console_result == NULL ) {
312
312
res = pymain_exit_err_print ();
@@ -570,7 +570,7 @@ pymain_run_stdin(PyConfig *config)
570
570
int run = PyRun_AnyFileExFlags (stdin , "<stdin>" , 0 , & cf );
571
571
return (run != 0 );
572
572
}
573
- return pymain_run_module ( L"_pyrepl" , 0 );
573
+ return pymain_start_pyrepl ( 0 );
574
574
}
575
575
576
576
@@ -603,7 +603,7 @@ pymain_repl(PyConfig *config, int *exitcode)
603
603
* exitcode = (run != 0 );
604
604
return ;
605
605
}
606
- int run = pymain_start_pyrepl ();
606
+ int run = pymain_start_pyrepl (1 );
607
607
* exitcode = (run != 0 );
608
608
return ;
609
609
}
0 commit comments