Skip to content

Remove unused local variable in PyImport_ImportModuleLevelObject #142666

Description

@hyongtao-code

Bug report

Bug description:

While learning PyImport_ImportModuleLevelObject, I noticed that the local
variable package is initialized to NULL, never assigned or used, and only
passed to Py_XDECREF at function exit.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Activity

  1. hyongtao-code commented on Dec 13, 2025

    @hyongtao-code
    ContributorAuthor

    Sorry, I shouldn’t have selected the type-bug label when creating the issue; I should have used the blank template instead. Please help me remove this incorrect label.

  2. added
    type-refactorCode refactoring (with no changes in behavior)
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Dec 13, 2025
  3. added a commit that references this issue on Dec 14, 2025
  4. added a commit that references this issue on Dec 16, 2025
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

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-refactorCode refactoring (with no changes in behavior)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions