Skip to content

Commit fd03956

Browse files
DinoVfacebook-github-bot
authored andcommitted
Fix anext issues
Summary: Backports this fix: python/cpython#131666 which marks our "close" as METH_NOARGS Also fixes the doc string so we get a proper `__text_signature__` Reviewed By: martindemello Differential Revision: D79215031 fbshipit-source-id: f97a7e777b261045bb072b880968e10e855e4f24
1 parent 39df93f commit fd03956

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

Jit/generators_rt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,11 @@ void init_jit_genobject_type() {
771771
static PyMethodDef anextawaitable_methods[] = {
772772
{"send", (PyCFunction)Ci_anextawaitable_send, METH_O, ""},
773773
{"throw", (PyCFunction)Ci_anextawaitable_throw, METH_VARARGS, ""},
774+
#if PY_VERSION_HEX >= 0x030E0000
775+
{"close", (PyCFunction)Ci_anextawaitable_close, METH_NOARGS, ""},
776+
#else
774777
{"close", (PyCFunction)Ci_anextawaitable_close, METH_VARARGS, ""},
778+
#endif
775779
{nullptr, nullptr} /* Sentinel */
776780
};
777781

TestScripts/3.14-opt-failures.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
test.test_coroutines
2-
test.test_inspect.test_inspect
31
test.test_threading
42
test_cinderx.test___static__
53
test_cinderx.test_cinderjit

_cinderx-lib.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,11 +1184,13 @@ PyMethodDef _cinderx_methods[] = {
11841184
{"anext",
11851185
reinterpret_cast<PyCFunction>(builtin_anext),
11861186
METH_FASTCALL,
1187-
"async anext(aiterator[, default])\n\n"
1188-
"Return the next item from the async iterator. If default is given and "
1189-
"the async\n"
1190-
"iterator is exhausted, it is returned instead of raising "
1191-
"StopAsyncIteration."},
1187+
"anext($module, aiterator, default=<unrepresentable>, /)\n"
1188+
"--\n"
1189+
"\n"
1190+
"Return the next item from the async iterator.\n"
1191+
"\n"
1192+
"If default is given and the async iterator is exhausted,\n"
1193+
"it is returned instead of raising StopAsyncIteration."},
11921194
{"delay_adaptive",
11931195
cinder_delay_adaptive,
11941196
METH_O,

0 commit comments

Comments
 (0)