This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] fix build failure with Python 3.7
- From: Pedro Alves <palves at redhat dot com>
- To: Paul dot Koning at dell dot com, sergiodj at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 1 Jun 2018 13:15:26 +0100
- Subject: Re: [PATCH] fix build failure with Python 3.7
- References: <96198491-96D8-42F0-9956-1C2BC9277050@dell.com> <87fu27fux2.fsf@redhat.com> <2BFDF702-C2E4-4339-ABB4-D0655063DE95@dell.com>
On 05/31/2018 09:45 PM, Paul.Koning@dell.com wrote:
>>> @@ -1667,6 +1667,14 @@ finalize_python (void *ignore)
>>> restore_active_ext_lang (previous_active);
>>> }
>>>
>>> +#ifdef IS_PY3K
>>> +PyMODINIT_FUNC
>>> +PyInit__gdb (void)
>>> +{
>>> + return PyModule_Create (&python_GdbModuleDef);
>>> +}
>>> +#endif
>>
>> I think it's a good idea to add a comment to this function.
>
> I added this (after the #ifdef):
>
> /* This is called via the PyImport_AppendInittab mechanism called
> during initialization, to make the built-in _gdb module known to
> Python. */
Can the function be made static?
I'm a little surprised to see the function being named "Py...", since
that kind of looks like stepping in Python's namespace.
Thanks,
Pedro Alves