gh-152297: Reify dotted lazy imports with the full dotted name#152307
gh-152297: Reify dotted lazy imports with the full dotted name#152307Kuhai9801 wants to merge 3 commits into
Conversation
85a1a27 to
e2f3da0
Compare
e2f3da0 to
18ced5b
Compare
|
The remaining Emscripten failure appears unrelated to this PR; it fails in |
pablogsal
left a comment
There was a problem hiding this comment.
Thanks for the PR! I think this still misses one dotted import case.
| ); | ||
| Py_DECREF(name); | ||
| } | ||
| obj = _PyEval_ImportNameWithImport( |
There was a problem hiding this comment.
Unless I am missing something, lazy import pkg.sub as alias still misses this. That path goes through _PyEval_LazyImportFrom() and reifies as __import__("pkg", fromlist=("sub",)), while eager import pkg.sub as alias calls __import__("pkg.sub", fromlist=()). We should fix/test that case as well.
|
Sorry I am going to also close this PR. You keep using AI without reviewing the code is producing and this is making review harder. You also keep adding api functions to everywhere which I don't understand why is needed. You are not weighting on the changes you produce Please stop this behavior or we will need to escalate |
Fix lazy reification for dotted imports so
lazy import pkg.subcalls__import__with the full dotted name, matching eager import behavior.The regression tests cover custom
__import__hooks and first-use loading of the dotted target.Tests:
git diff --check