Skip to content

Commit 700b619

Browse files
Update Python/bytecodes.c
Co-authored-by: Peter Bierma <[email protected]>
1 parent b089725 commit 700b619

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Python/bytecodes.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5042,11 +5042,7 @@ dummy_func(
50425042
}
50435043
} else if (oparg == 1) {
50445044
// Async case, similar to GET_AITER
5045-
unaryfunc getter = NULL;
5046-
if (type->tp_as_async != NULL) {
5047-
getter = type->tp_as_async->am_aiter;
5048-
}
5049-
if (getter == NULL) {
5045+
if (type->tp_as_async == NULL || type->tp_as_async->am_aiter == NULL) {
50505046
PyErr_Format(PyExc_TypeError,
50515047
"'async for' requires an object with "
50525048
"__aiter__ method, got %.100s",

0 commit comments

Comments
 (0)