mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-132775: Add _PyCode_ReturnsOnlyNone() (gh-132981)
The function indicates whether or not the function has a return statement. This is used by a later change related treating some functions like scripts.
This commit is contained in:
parent
75cbb8d89e
commit
96a7fb93a8
6 changed files with 123 additions and 1 deletions
|
@ -561,6 +561,10 @@ extern void _Py_ClearTLBCIndex(_PyThreadStateImpl *tstate);
|
|||
extern int _Py_ClearUnusedTLBC(PyInterpreterState *interp);
|
||||
#endif
|
||||
|
||||
|
||||
PyAPI_FUNC(int) _PyCode_ReturnsOnlyNone(PyCodeObject *);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -54,6 +54,9 @@ extern "C" {
|
|||
(opcode) == RAISE_VARARGS || \
|
||||
(opcode) == RERAISE)
|
||||
|
||||
#define IS_RETURN_OPCODE(opcode) \
|
||||
(opcode == RETURN_VALUE)
|
||||
|
||||
|
||||
/* Flags used in the oparg for MAKE_FUNCTION */
|
||||
#define MAKE_FUNCTION_DEFAULTS 0x01
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue