Skip to content

Commit db5a64e

Browse files
committed
Ensure the same pointer for strings
1 parent 52e6de9 commit db5a64e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Modules/_testcapi/module.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,12 @@ module_from_def_slot(PyObject *self, PyObject *spec)
271271
return result;
272272
}
273273

274+
static const char parrot_name[] = "test_capi/parrot";
275+
static const char parrot_doc[] = "created from redundant information";
274276
static PyModuleDef parrot_def = {
275277
PyModuleDef_HEAD_INIT,
276-
.m_name = "test_capi/parrot",
277-
.m_doc = "created from redundant information",
278+
.m_name = (void*)parrot_name,
279+
.m_doc = (void*)parrot_doc,
278280
.m_size = 123,
279281
.m_methods = a_methoddef_array,
280282
.m_traverse = noop_traverse,
@@ -283,8 +285,8 @@ static PyModuleDef parrot_def = {
283285
.m_slots = NULL /* set below */,
284286
};
285287
static PyModuleDef_Slot parrot_slots[] = {
286-
{Py_mod_name, "test_capi/parrot"},
287-
{Py_mod_doc, "created from redundant information"},
288+
{Py_mod_name, (void*)parrot_name},
289+
{Py_mod_doc, (void*)parrot_doc},
288290
{Py_mod_state_size, (void*)123},
289291
{Py_mod_methods, a_methoddef_array},
290292
{Py_mod_state_traverse, noop_traverse},

0 commit comments

Comments
 (0)