gh-145076: Validate type inputs in __lazy_import__#145088
gh-145076: Validate type inputs in __lazy_import__#145088andresliszt wants to merge 1 commit intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
3db62fc to
3d5d090
Compare
| PyObject *builtins; | ||
| PyThreadState *tstate = PyThreadState_GET(); | ||
|
|
||
| // Validate input arguments |
There was a problem hiding this comment.
Quick suggestion: check that we accept the same input types as PyImport_ImportModuleLevelObject does. I assume that __import__ and __lazy_import__ should behave similarly. I don't know if this is already the case with your PR but you could also refactor the logic of that validation in a single function that would be used in PyImport_ImportModuleLevelObject as well (so that we have similar error messages) (or just cc the logic).
|
Are those changes actually necessary now that #145086 is merged? |
Hello! first of all, thanks for this amazing project! best in the world. This is my very first attempt of contribution to cpython. This PR aims to fix the issue #145076, by adding validators to inputs in lazy_import
__lazy_import__throws aSystemErrorifglobalsis not any dict #145076