Skip to content

Commit 1be0129

Browse files
committed
Make PyFrame_GetState static for now.
1 parent 8cae06e commit 1be0129

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

Include/internal/pycore_frame.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ extern void _PyFrame_Fini(PyInterpreterState *interp);
2828

2929
/* other API */
3030

31+
typedef enum _framestate {
32+
FRAME_CREATED = -2,
33+
FRAME_SUSPENDED = -1,
34+
FRAME_EXECUTING = 0,
35+
FRAME_COMPLETED = 1,
36+
FRAME_CLEARED = 4
37+
} PyFrameState;
3138

3239
enum _frameowner {
3340
FRAME_OWNED_BY_THREAD = 0,

Objects/frameobject.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -406,15 +406,6 @@ frame_stack_pop(PyFrameObject *f)
406406
Py_DECREF(v);
407407
}
408408

409-
typedef enum _framestate {
410-
FRAME_CREATED = -2,
411-
FRAME_SUSPENDED = -1,
412-
FRAME_EXECUTING = 0,
413-
FRAME_COMPLETED = 1,
414-
FRAME_CLEARED = 4
415-
} PyFrameState;
416-
417-
418409
static PyFrameState
419410
_PyFrame_GetState(PyFrameObject *frame)
420411
{
@@ -479,7 +470,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
479470
return -1;
480471
}
481472

482-
PyFrameState state = PyFrame_GetState(f);
473+
PyFrameState state = _PyFrame_GetState(f);
483474
/*
484475
* This code preserves the historical restrictions on
485476
* setting the line number of a frame.
@@ -1076,7 +1067,7 @@ _PyFrame_LocalsToFast(_PyInterpreterFrame *frame, int clear)
10761067
void
10771068
PyFrame_LocalsToFast(PyFrameObject *f, int clear)
10781069
{
1079-
if (f == NULL || PyFrame_GetState(f) == FRAME_CLEARED) {
1070+
if (f == NULL || _PyFrame_GetState(f) == FRAME_CLEARED) {
10801071
return;
10811072
}
10821073
_PyFrame_LocalsToFast(f->f_frame, clear);

0 commit comments

Comments
 (0)