bpo-28411: Fix redundant declaration of _PyImport_AddModuleObject by jeremycline · Pull Request #7992 · python/cpython (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Commit 3f9eee6 ("bpo-28411: Support other mappings in
PyInterpreterState.modules.") introduced a new warning when building a C
extension with GCC and Python 3.7:
In file included from /usr/include/python3.7m/Python.h:126,
from /home/me/linux/packaging/tools/perf/util/python.c:2:
/usr/include/python3.7m/import.h:58:24: error: redundant redeclaration of
‘_PyImport_AddModuleObject’ [-Werror=redundant-decls]
PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *, PyObject *);
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.7m/import.h:47:24: note: previous declaration of
‘_PyImport_AddModuleObject’ was here
PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name,
^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
Both _PyImport_AddModuleObject declarations are within #ifndef Py_LIMITED_API
conditional block so drop one of them.
Signed-off-by: Jeremy Cline jeremy@jcline.org
https://bugs.python.org/issue28411
Commit 3f9eee6 ("bpo-28411: Support other mappings in PyInterpreterState.modules.") introduced a new warning when building a C extension with GCC and Python 3.7:
In file included from /usr/include/python3.7m/Python.h:126,
from /home/me/linux/packaging/tools/perf/util/python.c:2:
/usr/include/python3.7m/import.h:58:24: error: redundant redeclaration of
‘_PyImport_AddModuleObject’ [-Werror=redundant-decls]
PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *, PyObject *);
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/python3.7m/import.h:47:24: note: previous declaration of
‘_PyImport_AddModuleObject’ was here
PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name,
^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
Both _PyImport_AddModuleObject declarations are within #ifndef Py_LIMITED_API conditional block so drop one of them.
Signed-off-by: Jeremy Cline jeremy@jcline.org
Hello, and thanks for your contribution!
I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).
Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.
When your account is ready, please add a comment in this pull request
and a Python core developer will remove the CLA not signed
label
to make the bot check again.
Thanks again for your contribution, we look forward to reviewing it!
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that duplicate slipped back in as I rolled back out some of the changes from GH-1638 (reverted in GH-3565). GH-3575 added back the definition from the original change. Then GH-3593 added the duplicate.
I expect I intended on moving the definition restored in GH-3575 and accidentally left the old one in. :) So I'm fine with the PR as-is.
FYI, the PR is missing the issue number in the title (BPO-28411). It should probably also have a "skip news" label, since this is a small, otherwise transparent fix against GH-3593. We can do both, but will give you the chance first. :)
Finally, the bot noted you have not signed the CLA yet. While we are fine merging this PR without the CLA (it's a simple and obvious fix), we'd still recommend getting the CLA done.
jeremycline changed the title
Fix redundant declaration of _PyImport_AddModuleObject bpo-28411: Fix redundant declaration of _PyImport_AddModuleObject
FYI, the PR is missing the issue number in the title (BPO-28411). It should probably also have a "skip news" label, since this is a small, otherwise transparent fix against GH-3593. We can do both, but will give you the chance first. :)
Cool, I've fixed the title. It seemed too trivial to file a bug for and I wasn't sure if associating it with the original bug was normal protocol. I don't think I can add the label (or I'm missing something in the UI).
Finally, the bot noted you have not signed the CLA yet. While we are fine merging this PR without the CLA (it's a simple and obvious fix), we'd still recommend getting the CLA done.
I made a bugs.python.org account and submitted the CLA yesterday. It doesn't look like it's been confirmed yet, but it's not really been a full business day either 😄
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
(cherry picked from commit f874bd1)
Co-authored-by: Jeremy Cline jeremy@jcline.org
miss-islington added a commit that referenced this pull request
(cherry picked from commit f874bd1)
Co-authored-by: Jeremy Cline jeremy@jcline.org