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

Semantics ofPyThreadState_GetUnchecked insidetp_traverse handlers #142981

Open
@davidhewitt

Description

@davidhewitt

Following the recent discussion aboutrestrictions totp_traverse handlers.

In#131264 (comment)@colesbury noted that

PyThreadState_GetUnchecked() != NULL seems like a sufficient way to decide if it's safe to call into the interpreter.

I have previously observed thatPyThreadState_GetUnchecked will return non-null when inside atp_traverse handler. Should it be changed to returnNULL so that@colesbury 's statement remains valid insidetp_traverse handlers too?

If no, I have ways I can workaround in PyO3. But I worry about edge cases like a signal handler being hit inside oftp_traverse, maybe in that case code will need to check whether it is attached to the interpreter (withPyThreadStateGetUnchecked?) and then if not, safely fail to attach until the traverse has finished.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp