summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-07-25 13:28:30 (GMT)
committerGitHub <noreply@github.com>2023-07-25 13:28:30 (GMT)
commit1a3faba9f15e0c03c6cc0d225d377b8910b5379f (patch)
tree0aebe4139933835899fd5f618c023bceb9de0389 /Python/symtable.c
parented082383272c2c238e364e9cc83229234aee23cc (diff)
downloadcpython-1a3faba9f15e0c03c6cc0d225d377b8910b5379f.zip
cpython-1a3faba9f15e0c03c6cc0d225d377b8910b5379f.tar.gz
cpython-1a3faba9f15e0c03c6cc0d225d377b8910b5379f.tar.bz2
gh-106869: Use new PyMemberDef constant names (#106871)
* Remove '#include "structmember.h"'. * If needed, add <stddef.h> to get offsetof() function. * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Replace: * T_SHORT => Py_T_SHORT * T_INT => Py_T_INT * T_LONG => Py_T_LONG * T_FLOAT => Py_T_FLOAT * T_DOUBLE => Py_T_DOUBLE * T_STRING => Py_T_STRING * T_OBJECT => _Py_T_OBJECT * T_CHAR => Py_T_CHAR * T_BYTE => Py_T_BYTE * T_UBYTE => Py_T_UBYTE * T_USHORT => Py_T_USHORT * T_UINT => Py_T_UINT * T_ULONG => Py_T_ULONG * T_STRING_INPLACE => Py_T_STRING_INPLACE * T_BOOL => Py_T_BOOL * T_OBJECT_EX => Py_T_OBJECT_EX * T_LONGLONG => Py_T_LONGLONG * T_ULONGLONG => Py_T_ULONGLONG * T_PYSSIZET => Py_T_PYSSIZET * T_NONE => _Py_T_NONE * READONLY => Py_READONLY * PY_AUDIT_READ => Py_AUDIT_READ * READ_RESTRICTED => Py_AUDIT_READ * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 2407367..04be319 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -3,7 +3,7 @@
#include "pycore_parser.h" // _PyParser_ASTFromString()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_symtable.h" // PySTEntryObject
-#include "structmember.h" // PyMemberDef
+
/* error strings used for warnings */
#define GLOBAL_PARAM \
@@ -171,14 +171,14 @@ ste_dealloc(PySTEntryObject *ste)
#define OFF(x) offsetof(PySTEntryObject, x)
static PyMemberDef ste_memberlist[] = {
- {"id", T_OBJECT, OFF(ste_id), READONLY},
- {"name", T_OBJECT, OFF(ste_name), READONLY},
- {"symbols", T_OBJECT, OFF(ste_symbols), READONLY},
- {"varnames", T_OBJECT, OFF(ste_varnames), READONLY},
- {"children", T_OBJECT, OFF(ste_children), READONLY},
- {"nested", T_INT, OFF(ste_nested), READONLY},
- {"type", T_INT, OFF(ste_type), READONLY},
- {"lineno", T_INT, OFF(ste_lineno), READONLY},
+ {"id", _Py_T_OBJECT, OFF(ste_id), Py_READONLY},
+ {"name", _Py_T_OBJECT, OFF(ste_name), Py_READONLY},
+ {"symbols", _Py_T_OBJECT, OFF(ste_symbols), Py_READONLY},
+ {"varnames", _Py_T_OBJECT, OFF(ste_varnames), Py_READONLY},
+ {"children", _Py_T_OBJECT, OFF(ste_children), Py_READONLY},
+ {"nested", Py_T_INT, OFF(ste_nested), Py_READONLY},
+ {"type", Py_T_INT, OFF(ste_type), Py_READONLY},
+ {"lineno", Py_T_INT, OFF(ste_lineno), Py_READONLY},
{NULL}
};