Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 1 | From 069e109c95d1afca17cd3781b39f220cf8b39978 Mon Sep 17 00:00:00 2001 |
| 2 | From: Stan Cox <scox@redhat.com> |
| 3 | Date: Wed, 13 Jul 2022 09:49:51 -0400 |
| 4 | Subject: [PATCH 1/1] python 3.11 removed direct access to PyFrameObject |
| 5 | members |
| 6 | |
| 7 | Take into account the change in PyFrameObject definition to allow |
| 8 | building systemtap with python 3.11. Additional support for python |
| 9 | 3.11 is forthcoming. |
| 10 | |
| 11 | Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=069e109c95d1afca17cd3781b39f220cf8b39978] |
| 12 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 13 | --- |
| 14 | python/HelperSDT/_HelperSDT.c | 6 ++++++ |
| 15 | 1 file changed, 6 insertions(+) |
| 16 | |
| 17 | diff --git a/python/HelperSDT/_HelperSDT.c b/python/HelperSDT/_HelperSDT.c |
| 18 | index 967cb6077..4d287132e 100644 |
| 19 | --- a/python/HelperSDT/_HelperSDT.c |
| 20 | +++ b/python/HelperSDT/_HelperSDT.c |
| 21 | @@ -14,7 +14,13 @@ |
| 22 | // PR25841: ensure that the libHelperSDT.so file contains debuginfo |
| 23 | // for the tapset helper functions, so they don't have to look into libpython* |
| 24 | #include <frameobject.h> |
| 25 | +// python 3.11 removed direct access to PyFrameObject members |
| 26 | +// https://docs.python.org/3.11/whatsnew/3.11.html#c-api-changes |
| 27 | +#if PY_MAJOR_VERSION <= 3 && PY_MINOR_VERSION < 11 |
| 28 | PyFrameObject _dummy_frame; |
| 29 | +#else |
| 30 | +//PyFrameObject *_dummy_frame; |
| 31 | +#endif |
| 32 | #include <object.h> |
| 33 | PyVarObject _dummy_var; |
| 34 | #include <dictobject.h> |
| 35 | -- |
| 36 | 2.31.1 |
| 37 | |