Skip to content

__lazy_import__ throws a SystemError if globals is not any dict #145076

@devdanzin

Description

@devdanzin

Bug report

Bug description:

The interpreter will raise a SystemError when __lazy_import__ is called with a second positional argument:

>>> __lazy_import__('', 1)
Traceback (most recent call last):
  File "<python-input-82>", line 1, in <module>
    __lazy_import__('', 1)
    ~~~~~~~~~~~~~~~^^^^^^^
SystemError: Objects/dictobject.c:2499: bad argument to internal function

Found using fusil by @vstinner.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-importlibtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions