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

[mypyc] Fix using package imported inside a function #9782

Merged
merged 3 commits into from
Dec 8, 2020
Merged

Commits on Dec 6, 2020

  1. [mypyc] Fix reading package imported inside a function

    This fixes an issue where this code resulted in an unbound local `p`
    error:
    
    ```
    def f() -> None:
        import p.submodule
        print(p.x)  # Runtime error here
    ```
    
    We now look up `p` from the global modules dictionary instead
    of trying to use an undefined local variable.
    JukkaL committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    5a4f0f6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7341caf View commit details
    Browse the repository at this point in the history
  3. Add test cases

    JukkaL committed Dec 6, 2020
    Configuration menu
    Copy the full SHA
    fc26c1b View commit details
    Browse the repository at this point in the history