-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-28411: Fix redundant declaration of _PyImport_AddModuleObject #7992
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-28411: Fix redundant declaration of _PyImport_AddModuleObject #7992
Conversation
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 <[email protected]>
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 Thanks again for your contribution, we look forward to reviewing it! |
There was a problem hiding this comment.
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.
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).
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 😄 |
Thanks @jeremycline for the PR, and @ericsnowcurrently for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
GH-8017 is a backport of this pull request to the 3.7 branch. |
(cherry picked from commit f874bd1) Co-authored-by: Jeremy Cline <[email protected]>
(cherry picked from commit f874bd1) Co-authored-by: Jeremy Cline <[email protected]>
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:
Both _PyImport_AddModuleObject declarations are within #ifndef Py_LIMITED_API
conditional block so drop one of them.
Signed-off-by: Jeremy Cline [email protected]
https://bugs.python.org/issue28411