]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120029: remove unused macros in ``symtable.c`` (#120222)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Wed, 12 Jun 2024 13:23:45 +0000 (15:23 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2024 13:23:45 +0000 (09:23 -0400)
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Include/internal/pycore_symtable.h
Modules/symtablemodule.c
Python/symtable.c

index 1be48edc80c8306316064839ca2da675bded7368..519505c0edf52abea3dd62d973380745b11575a8 100644 (file)
@@ -143,7 +143,6 @@ extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);
 #define DEF_PARAM (2<<1)         /* formal parameter */
 #define DEF_NONLOCAL (2<<2)      /* nonlocal stmt */
 #define USE (2<<3)               /* name is used */
-#define DEF_FREE (2<<4)          /* name used but not defined in nested block */
 #define DEF_FREE_CLASS (2<<5)    /* free variable from class's method */
 #define DEF_IMPORT (2<<6)        /* assignment occurred via import */
 #define DEF_ANNOT (2<<7)         /* this name is annotated */
@@ -166,9 +165,6 @@ extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);
 #define FREE 4
 #define CELL 5
 
-#define GENERATOR 1
-#define GENERATOR_EXPRESSION 2
-
 // Used by symtablemodule.c
 extern struct symtable* _Py_SymtableStringObjectFlags(
     const char *str,
index b39b59bf7b06bf109ab978ff96ff7608faa82198..618465536e7851cdb6b0558071b4cccd344c94d1 100644 (file)
@@ -76,7 +76,6 @@ symtable_init_constants(PyObject *m)
     if (PyModule_AddIntMacro(m, DEF_LOCAL) < 0) return -1;
     if (PyModule_AddIntMacro(m, DEF_PARAM) < 0) return -1;
     if (PyModule_AddIntMacro(m, DEF_TYPE_PARAM) < 0) return -1;
-    if (PyModule_AddIntMacro(m, DEF_FREE) < 0) return -1;
     if (PyModule_AddIntMacro(m, DEF_FREE_CLASS) < 0) return -1;
     if (PyModule_AddIntMacro(m, DEF_IMPORT) < 0) return -1;
     if (PyModule_AddIntMacro(m, DEF_BOUND) < 0) return -1;
index 627184da9ef4ed9fa32f3853ccd50205f2bab37a..0490014166e65ccdfc5c00e772e002c9af9bf628 100644 (file)
@@ -327,7 +327,6 @@ static void _dump_symtable(PySTEntryObject* ste, PyObject* prefix)
         if (flags & DEF_PARAM) printf(" DEF_PARAM");
         if (flags & DEF_NONLOCAL) printf(" DEF_NONLOCAL");
         if (flags & USE) printf(" USE");
-        if (flags & DEF_FREE) printf(" DEF_FREE");
         if (flags & DEF_FREE_CLASS) printf(" DEF_FREE_CLASS");
         if (flags & DEF_IMPORT) printf(" DEF_IMPORT");
         if (flags & DEF_ANNOT) printf(" DEF_ANNOT");