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

Commite79f640

Browse files
authored
Simplify interp_look_up_id() (#134257)
Don't use PyInterpreterState_GetID() but get directly the interpreter'id' member which cannot fail.
1 parent71c42b7 commite79f640

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎Python/pystate.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,10 +1393,8 @@ interp_look_up_id(_PyRuntimeState *runtime, int64_t requested_id)
13931393
{
13941394
PyInterpreterState*interp=runtime->interpreters.head;
13951395
while (interp!=NULL) {
1396-
int64_tid=PyInterpreterState_GetID(interp);
1397-
if (id<0) {
1398-
returnNULL;
1399-
}
1396+
int64_tid=interp->id;
1397+
assert(id >=0);
14001398
if (requested_id==id) {
14011399
returninterp;
14021400
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp