@@ -2464,20 +2464,7 @@ _PySys_EndInit(PyObject *sysdict, _PyMainInterpreterConfig *config)
24642464 assert (config -> exec_prefix != NULL );
24652465 assert (config -> base_exec_prefix != NULL );
24662466
2467- #define COPY_LIST (KEY , ATTR ) \
2468- do { \
2469- assert(PyList_Check(config->ATTR)); \
2470- PyObject *list = PyList_GetSlice(config->ATTR, \
2471- 0, PyList_GET_SIZE(config->ATTR)); \
2472- if (list == NULL) { \
2473- return -1; \
2474- } \
2475- SET_SYS_FROM_STRING_BORROW(KEY, list); \
2476- Py_DECREF(list); \
2477- } while (0)
2478-
2479- COPY_LIST ("path" , module_search_path );
2480-
2467+ SET_SYS_FROM_STRING_BORROW ("path" , config -> module_search_path );
24812468 SET_SYS_FROM_STRING_BORROW ("executable" , config -> executable );
24822469 SET_SYS_FROM_STRING_BORROW ("prefix" , config -> prefix );
24832470 SET_SYS_FROM_STRING_BORROW ("base_prefix" , config -> base_prefix );
@@ -2488,19 +2475,12 @@ _PySys_EndInit(PyObject *sysdict, _PyMainInterpreterConfig *config)
24882475 SET_SYS_FROM_STRING_BORROW ("argv" , config -> argv );
24892476 }
24902477 if (config -> warnoptions != NULL ) {
2491- COPY_LIST ("warnoptions" , warnoptions );
2478+ SET_SYS_FROM_STRING_BORROW ("warnoptions" , config -> warnoptions );
24922479 }
24932480 if (config -> xoptions != NULL ) {
2494- PyObject * dict = PyDict_Copy (config -> xoptions );
2495- if (dict == NULL ) {
2496- return -1 ;
2497- }
2498- SET_SYS_FROM_STRING_BORROW ("_xoptions" , dict );
2499- Py_DECREF (dict );
2481+ SET_SYS_FROM_STRING_BORROW ("_xoptions" , config -> xoptions );
25002482 }
25012483
2502- #undef COPY_LIST
2503-
25042484 /* Set flags to their final values */
25052485 SET_SYS_FROM_STRING_INT_RESULT ("flags" , make_flags ());
25062486 /* prevent user from creating new instances */
0 commit comments