mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
GH-89091: raise RuntimeWarning for unawaited async generator methods (#104611)
This commit is contained in:
parent
46857d0b2a
commit
7fc542c88d
9 changed files with 96 additions and 2 deletions
|
|
@ -781,6 +781,7 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
|
|||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(a));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(abs_tol));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(access));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(aclose));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(add));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(add_done_callback));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(after_in_child));
|
||||
|
|
@ -794,7 +795,9 @@ _PyStaticObjects_CheckRefcnt(PyInterpreterState *interp) {
|
|||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(arguments));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(argv));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(as_integer_ratio));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(asend));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(ast));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(athrow));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(attribute));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(authorizer_callback));
|
||||
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(autocommit));
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_ID(a)
|
||||
STRUCT_FOR_ID(abs_tol)
|
||||
STRUCT_FOR_ID(access)
|
||||
STRUCT_FOR_ID(aclose)
|
||||
STRUCT_FOR_ID(add)
|
||||
STRUCT_FOR_ID(add_done_callback)
|
||||
STRUCT_FOR_ID(after_in_child)
|
||||
|
|
@ -282,7 +283,9 @@ struct _Py_global_strings {
|
|||
STRUCT_FOR_ID(arguments)
|
||||
STRUCT_FOR_ID(argv)
|
||||
STRUCT_FOR_ID(as_integer_ratio)
|
||||
STRUCT_FOR_ID(asend)
|
||||
STRUCT_FOR_ID(ast)
|
||||
STRUCT_FOR_ID(athrow)
|
||||
STRUCT_FOR_ID(attribute)
|
||||
STRUCT_FOR_ID(authorizer_callback)
|
||||
STRUCT_FOR_ID(autocommit)
|
||||
|
|
|
|||
3
Include/internal/pycore_runtime_init_generated.h
generated
3
Include/internal/pycore_runtime_init_generated.h
generated
|
|
@ -775,6 +775,7 @@ extern "C" {
|
|||
INIT_ID(a), \
|
||||
INIT_ID(abs_tol), \
|
||||
INIT_ID(access), \
|
||||
INIT_ID(aclose), \
|
||||
INIT_ID(add), \
|
||||
INIT_ID(add_done_callback), \
|
||||
INIT_ID(after_in_child), \
|
||||
|
|
@ -788,7 +789,9 @@ extern "C" {
|
|||
INIT_ID(arguments), \
|
||||
INIT_ID(argv), \
|
||||
INIT_ID(as_integer_ratio), \
|
||||
INIT_ID(asend), \
|
||||
INIT_ID(ast), \
|
||||
INIT_ID(athrow), \
|
||||
INIT_ID(attribute), \
|
||||
INIT_ID(authorizer_callback), \
|
||||
INIT_ID(autocommit), \
|
||||
|
|
|
|||
|
|
@ -648,6 +648,9 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
|
|||
string = &_Py_ID(access);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(aclose);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(add);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
|
|
@ -687,9 +690,15 @@ _PyUnicode_InitStaticStrings(PyInterpreterState *interp) {
|
|||
string = &_Py_ID(as_integer_ratio);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(asend);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(ast);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(athrow);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
string = &_Py_ID(attribute);
|
||||
assert(_PyUnicode_CheckConsistency(string, 1));
|
||||
_PyUnicode_InternInPlace(interp, &string);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ extern int _PyWarnings_InitState(PyInterpreterState *interp);
|
|||
PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
|
||||
|
||||
extern void _PyErr_WarnUnawaitedCoroutine(PyObject *coro);
|
||||
extern void _PyErr_WarnUnawaitedAgenMethod(PyAsyncGenObject *agen, PyObject *method);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue