-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-31415: Improve caching of the importtime option. #4138
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-31415: Improve caching of the importtime option. #4138
Conversation
ncoghlan
left a comment
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.
The actual change looks good to me, but there's a now outdated comment that needs to be adjusted to match the new implementation (we know that the -X options will have been processed by the time Py_IsInitialized() returns true.
Python/import.c
Outdated
| Py_XDECREF(mod); | ||
|
|
||
| /* XOptions is initialized after first some imports. | ||
| * So we can't have negative cache. |
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.
Is this comment still true? The check for Py_IsInitialized() below means that there now is a negative cache for ximporttime == 0.
|
Please double check, but I think I've resolved the conflicts. I did not remove the comment that @ncoghlan pointed out, but I agree it should probably be removed. |
Try to resolve conflicts correctly.
Resolving conflicts in GH web ui is hard!
|
If we don't fix the comment in this PR, I suspect the odds of fixing it later are pretty low :) |
|
Agreed! I tried to keep my change narrowly focused on resolving the conflict. @serhiy-storchaka I'm happy to make this last change if you want, or you can do it since it's your branch :) |
https://bugs.python.org/issue31415