Skip to content
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

importlib: set children as attribute of parent modules #12208

Merged
merged 7 commits into from
Apr 20, 2024

Commits on Apr 20, 2024

  1. Configuration menu
    Copy the full SHA
    70dd4b0 View commit details
    Browse the repository at this point in the history
  2. importlib: _import_module_using_spec also imports parent modules

    According to the Python import implementation:
    
    https://github.com/python/cpython/blob/73906d5c908c1e0b73c5436faeff7d93698fc074/Lib/importlib/_bootstrap.py#L1308-L1311
    
    When we import a module we should also import its parents, and set the child as attribute of its parent.
    nicoddemus committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    f428918 View commit details
    Browse the repository at this point in the history
  3. Use _import_module_using_spec to import parent modules

    Seems this is the right thing to do, as we will then also consider the parent modules for rewriting.
    nicoddemus committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    3c6caf6 View commit details
    Browse the repository at this point in the history
  4. Remove outdated comment

    Seems we need to insert missing modules when the modules are not part of a package or namespace package.
    nicoddemus committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    9dc41a7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    91146ea View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f62efb9 View commit details
    Browse the repository at this point in the history
  7. Additional test

    nicoddemus committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    9cbbcf7 View commit details
    Browse the repository at this point in the history