@@ -206,7 +206,7 @@ static int compiler_set_qualname(struct compiler *);
206206static PyCodeObject * assemble (struct compiler * , int addNone );
207207static PyObject * __doc__ ;
208208
209- #define COMPILER_CAPSULE_NAME_COMPILER_UNIT "compile.c compiler unit"
209+ #define CAPSULE_NAME "compile.c compiler unit"
210210
211211PyObject *
212212_Py_Mangle (PyObject * privateobj , PyObject * ident )
@@ -608,7 +608,7 @@ compiler_enter_scope(struct compiler *c, identifier name,
608608
609609 /* Push the old compiler_unit on the stack. */
610610 if (c -> u ) {
611- PyObject * capsule = PyCapsule_New (c -> u , COMPILER_CAPSULE_NAME_COMPILER_UNIT , NULL );
611+ PyObject * capsule = PyCapsule_New (c -> u , CAPSULE_NAME , NULL );
612612 if (!capsule || PyList_Append (c -> c_stack , capsule ) < 0 ) {
613613 Py_XDECREF (capsule );
614614 compiler_unit_free (u );
@@ -644,7 +644,7 @@ compiler_exit_scope(struct compiler *c)
644644 n = PyList_GET_SIZE (c -> c_stack ) - 1 ;
645645 if (n >= 0 ) {
646646 capsule = PyList_GET_ITEM (c -> c_stack , n );
647- c -> u = (struct compiler_unit * )PyCapsule_GetPointer (capsule , COMPILER_CAPSULE_NAME_COMPILER_UNIT );
647+ c -> u = (struct compiler_unit * )PyCapsule_GetPointer (capsule , CAPSULE_NAME );
648648 assert (c -> u );
649649 /* we are deleting from a list so this really shouldn't fail */
650650 if (PySequence_DelItem (c -> c_stack , n ) < 0 )
@@ -674,7 +674,7 @@ compiler_set_qualname(struct compiler *c)
674674 PyObject * mangled , * capsule ;
675675
676676 capsule = PyList_GET_ITEM (c -> c_stack , stack_size - 1 );
677- parent = (struct compiler_unit * )PyCapsule_GetPointer (capsule , COMPILER_CAPSULE_NAME_COMPILER_UNIT );
677+ parent = (struct compiler_unit * )PyCapsule_GetPointer (capsule , CAPSULE_NAME );
678678 assert (parent );
679679
680680 if (u -> u_scope_type == COMPILER_SCOPE_FUNCTION || u -> u_scope_type == COMPILER_SCOPE_CLASS ) {
0 commit comments