summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-python/recipes-devtools/python/python3-yappi/python310.patch
blob: 6dd58ae9687b1e8db5955c34cefc358bf651de4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From d40bc0e8230dd35e05222f5761e3d7f7a75fd46e Mon Sep 17 00:00:00 2001
From: Alexander Shadchin <shadchin@yandex-team.ru>
Date: Tue, 1 Jun 2021 02:31:12 +0300
Subject: [PATCH] Adapt to Python 3.10 beta 1

Upstream-Status: Backport
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 yappi/_yappi.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/yappi/_yappi.c b/yappi/_yappi.c
index 1721280..343130d 100644
--- a/yappi/_yappi.c
+++ b/yappi/_yappi.c
@@ -1258,7 +1258,11 @@ _resume_greenlet_ctx(_ctx *ctx)
 static _ctx *
 _bootstrap_thread(PyThreadState *ts)
 {
+#if PY_VERSION_HEX < 0x030a00b1
     ts->use_tracing = 1;
+#else
+    ts->cframe->use_tracing = 1;
+#endif
     ts->c_profilefunc = _yapp_callback;
     return NULL;
 }
@@ -1289,7 +1293,11 @@ _profile_thread(PyThreadState *ts)
         ctx = (_ctx *)it->val;
     }
     
+#if PY_VERSION_HEX < 0x030a00b1
     ts->use_tracing = 1;
+#else
+    ts->cframe->use_tracing = 1;
+#endif
     ts->c_profilefunc = _yapp_callback;
     ctx->id = ctx_id;
     ctx->tid = ts->thread_id;
@@ -1306,7 +1314,11 @@ _profile_thread(PyThreadState *ts)
 static _ctx*
 _unprofile_thread(PyThreadState *ts)
 {
+#if PY_VERSION_HEX < 0x030a00b1
     ts->use_tracing = 0;
+#else
+    ts->cframe->use_tracing = 0;
+#endif
     ts->c_profilefunc = NULL;
 
     return NULL; //dummy return for enum_threads() func. prototype