Skip to content

Lazy import traceback points to another module's declaration #158597

Description

@pablogsal

With #158521 applied:

A.py:

lazy import xml.missing
import B

xml.missing

B.py:

lazy import xml.missing

Run python A.py. The chained ImportError points to B.py:1, but it should point to the declaration in A.py:1.

Reproduced on 3.16.0a0, Linux. Follow-up to the discussion on #158521.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions