mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant()
when applicable.
This commit is contained in:
parent
d66b10e165
commit
74ca886788
12 changed files with 681 additions and 708 deletions
|
|
@ -69,30 +69,30 @@ PyInit__symtable(void)
|
|||
m = PyModule_Create(&symtablemodule);
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
PyModule_AddIntConstant(m, "USE", USE);
|
||||
PyModule_AddIntConstant(m, "DEF_GLOBAL", DEF_GLOBAL);
|
||||
PyModule_AddIntConstant(m, "DEF_LOCAL", DEF_LOCAL);
|
||||
PyModule_AddIntConstant(m, "DEF_PARAM", DEF_PARAM);
|
||||
PyModule_AddIntConstant(m, "DEF_FREE", DEF_FREE);
|
||||
PyModule_AddIntConstant(m, "DEF_FREE_CLASS", DEF_FREE_CLASS);
|
||||
PyModule_AddIntConstant(m, "DEF_IMPORT", DEF_IMPORT);
|
||||
PyModule_AddIntConstant(m, "DEF_BOUND", DEF_BOUND);
|
||||
PyModule_AddIntMacro(m, USE);
|
||||
PyModule_AddIntMacro(m, DEF_GLOBAL);
|
||||
PyModule_AddIntMacro(m, DEF_LOCAL);
|
||||
PyModule_AddIntMacro(m, DEF_PARAM);
|
||||
PyModule_AddIntMacro(m, DEF_FREE);
|
||||
PyModule_AddIntMacro(m, DEF_FREE_CLASS);
|
||||
PyModule_AddIntMacro(m, DEF_IMPORT);
|
||||
PyModule_AddIntMacro(m, DEF_BOUND);
|
||||
|
||||
PyModule_AddIntConstant(m, "TYPE_FUNCTION", FunctionBlock);
|
||||
PyModule_AddIntConstant(m, "TYPE_CLASS", ClassBlock);
|
||||
PyModule_AddIntConstant(m, "TYPE_MODULE", ModuleBlock);
|
||||
|
||||
PyModule_AddIntConstant(m, "OPT_IMPORT_STAR", OPT_IMPORT_STAR);
|
||||
PyModule_AddIntConstant(m, "OPT_TOPLEVEL", OPT_TOPLEVEL);
|
||||
PyModule_AddIntMacro(m, OPT_IMPORT_STAR);
|
||||
PyModule_AddIntMacro(m, OPT_TOPLEVEL);
|
||||
|
||||
PyModule_AddIntConstant(m, "LOCAL", LOCAL);
|
||||
PyModule_AddIntConstant(m, "GLOBAL_EXPLICIT", GLOBAL_EXPLICIT);
|
||||
PyModule_AddIntConstant(m, "GLOBAL_IMPLICIT", GLOBAL_IMPLICIT);
|
||||
PyModule_AddIntConstant(m, "FREE", FREE);
|
||||
PyModule_AddIntConstant(m, "CELL", CELL);
|
||||
PyModule_AddIntMacro(m, LOCAL);
|
||||
PyModule_AddIntMacro(m, GLOBAL_EXPLICIT);
|
||||
PyModule_AddIntMacro(m, GLOBAL_IMPLICIT);
|
||||
PyModule_AddIntMacro(m, FREE);
|
||||
PyModule_AddIntMacro(m, CELL);
|
||||
|
||||
PyModule_AddIntConstant(m, "SCOPE_OFF", SCOPE_OFFSET);
|
||||
PyModule_AddIntConstant(m, "SCOPE_MASK", SCOPE_MASK);
|
||||
PyModule_AddIntMacro(m, SCOPE_MASK);
|
||||
|
||||
if (PyErr_Occurred()) {
|
||||
Py_DECREF(m);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue