[3.13] gh-123930: Better error for "from imports" when script shadows module (GH-123929) (#125937)

gh-123930: Better error for "from imports" when script shadows module (#123929)

(cherry picked from commit 500f5338a8)
This commit is contained in:
Shantanu 2024-10-24 12:37:31 -07:00 committed by GitHub
parent 4b55d53316
commit 3d8b6f0977
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 344 additions and 171 deletions

View file

@ -11,6 +11,8 @@ extern "C" {
extern void _PyModule_Clear(PyObject *);
extern void _PyModule_ClearDict(PyObject *);
extern int _PyModuleSpec_IsInitializing(PyObject *);
extern int _PyModuleSpec_GetFileOrigin(PyObject *, PyObject **);
extern int _PyModule_IsPossiblyShadowing(PyObject *);
extern int _PyModule_IsExtension(PyObject *obj);