Skip to content

Commit 076b060

Browse files
_PyCode_Returns() -> _PyCode_ReturnsValue().
1 parent dc8230d commit 076b060

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Include/internal/pycore_code.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ extern int _Py_ClearUnusedTLBC(PyInterpreterState *interp);
562562
#endif
563563

564564

565-
PyAPI_FUNC(int) _PyCode_Returns(PyCodeObject *);
565+
PyAPI_FUNC(int) _PyCode_ReturnsValue(PyCodeObject *);
566566

567567

568568
#ifdef __cplusplus

Objects/codeobject.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,8 +1690,11 @@ PyCode_GetFreevars(PyCodeObject *code)
16901690
}
16911691

16921692

1693+
/* Here "value" means a non-None value, since a bare return is identical
1694+
* to returning None explicitly. Likewise a missing return statement
1695+
* at the end of the function is turned into "return None". */
16931696
int
1694-
_PyCode_Returns(PyCodeObject *co)
1697+
_PyCode_ReturnsValue(PyCodeObject *co)
16951698
{
16961699
// Look up None in co_consts.
16971700
Py_ssize_t nconsts = PyTuple_Size(co->co_consts);

0 commit comments

Comments
 (0)