You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-10-11.14:06:22.416>created_at=<Date2020-10-10.21:01:19.362>labels= ['interpreter-core', '3.10']
title='Clean up initialization of the sys module'updated_at=<Date2020-10-11.14:06:22.415>user='https://github.com/serhiy-storchaka'
_PySys_InitCore() and _PySys_InitMain() in Python/sysmodule.c contains many invocations of macros for setting attributes of the sys module. The proposed PR changes these macros.
SET_SYS_FROM_STRING was renamed to just SET_SYS. It is much shorter and allow to write many invocations in one line. Also SET_SYS_FROM_STRING was not consistent with SET_SYS_FROM_WSTR.
Added new SET_SYS_FROM_STRING which sets attribute specified as C char string (similarly to SET_SYS_FROM_WSTR which sets attribute specified as C wchar_t string).
Added COPY_SYS_ATTR for making a copy of the attribute. It uses PyMapping_GetItemString() instead of PyDict_GetItemString() which silences all expressions.
Removed SET_SYS_FROM_STRING_BORROW. It no longer used, and it was used improperly.
SET_SYS_FROM_STRING_INT_RESULT replaced with SET_SYS.
All macros have been rewritten in term of SET_SYS that significantly simplifies the code.
All this makes the code clearer and makes errors handling more correct.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: