Skip to content

Commit b681275

Browse files
committed
Refactoring Modules/main.c
1 parent d4ed766 commit b681275

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Modules/main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,8 @@ pymain_start_pyrepl(void)
305305
res = pymain_exit_err_print();
306306
goto done;
307307
}
308-
if (!PyDict_SetItemString(kwargs, "pythonstartup", _PyLong_GetOne())) {
309-
if (PyDict_SetItemString(kwargs, "mainmodule", main_module) < 0) {
310-
res = pymain_exit_err_print();
311-
goto done;
312-
}
308+
if (!PyDict_SetItemString(kwargs, "mainmodule", main_module)
309+
&& !PyDict_SetItemString(kwargs, "pythonstartup", _PyLong_GetOne())) {
313310
console_result = PyObject_Call(console, empty_tuple, kwargs);
314311
if (console_result == NULL) {
315312
res = pymain_exit_err_print();

0 commit comments

Comments
 (0)