Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PyType_GetModuleByDef can return NULL without exception set #133166

Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or error
@iritkatriel

Description

@iritkatriel

Thedocumentation does not mention that this is possible, but if the object passed in is not a heap type it returnsNULL without setting an exception:

PyObject *PyType_GetModuleByDef(PyTypeObject *type, PyModuleDef *def){    assert(PyType_Check(type));       if (!_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE)) {        // type_ready_mro() ensures that no heap type is        // contained in a static type MRO.        return NULL;    }   ...}

CC@ericsnowcurrently@encukou .

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp