Skip to content

Commit

Permalink
Update greenlet for Python 3.11
Browse files Browse the repository at this point in the history
From python-greenlet/greenlet#306

Co-Authored-By: Victor Stinner <vstinner@python.org>
  • Loading branch information
hroncok and vstinner committed Jun 8, 2022
1 parent 5858d22 commit af14567
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion deps/greenlet/greenlet.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ extern "C" {
/* This is deprecated and undocumented. It does not change. */
#define GREENLET_VERSION "1.0.0"

#if PY_VERSION_HEX >= 0x30B00A6
# define GREENLET_PY311 1
/* We need this for _PyInterpreterFrame apparently */
#include <internal/pycore_frame.h>
#else
#define GREENLET_PY311 0
#define _PyCFrame CFrame
#endif

typedef struct _greenlet {
PyObject_HEAD
char* stack_start;
Expand All @@ -25,6 +34,12 @@ typedef struct _greenlet {
PyObject* run_info;
struct _frame* top_frame;
int recursion_depth;
#if GREENLET_PY311
_PyInterpreterFrame *current_frame;
_PyStackChunk *datastack_chunk;
PyObject **datastack_top;
PyObject **datastack_limit;
#endif
PyObject* weakreflist;
#if PY_VERSION_HEX >= 0x030700A3
_PyErr_StackItem* exc_info;
Expand All @@ -39,7 +54,7 @@ typedef struct _greenlet {
PyObject* context;
#endif
#if PY_VERSION_HEX >= 0x30A00B1
CFrame* cframe;
_PyCFrame* cframe;
#endif
} PyGreenlet;

Expand Down

0 comments on commit af14567

Please sign in to comment.