summaryrefslogtreecommitdiffstats
path: root/Include/cpython/code.h
diff options
context:
space:
mode:
authorKen Jin <kenjin4096@gmail.com>2022-05-03 13:13:13 (GMT)
committerGitHub <noreply@github.com>2022-05-03 13:13:13 (GMT)
commit6c7249f2655749a06b4674a17537f844bd54d217 (patch)
tree15c7131fdf51411d2e8e566347f75e9f0809f508 /Include/cpython/code.h
parent1d4a9a45b7ac8c1c5fecc363c988be59500f1ed7 (diff)
downloadcpython-6c7249f2655749a06b4674a17537f844bd54d217.zip
cpython-6c7249f2655749a06b4674a17537f844bd54d217.tar.gz
cpython-6c7249f2655749a06b4674a17537f844bd54d217.tar.bz2
gh-92154: Expose PyCode_GetCode in the C API (GH-92168)
Diffstat (limited to 'Include/cpython/code.h')
-rw-r--r--Include/cpython/code.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h
index be3b10b..ba7324b 100644
--- a/Include/cpython/code.h
+++ b/Include/cpython/code.h
@@ -202,6 +202,9 @@ PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index,
PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index,
void *extra);
+/* Equivalent to getattr(code, 'co_code') in Python.
+ Returns a strong reference to a bytes object. */
+PyAPI_FUNC(PyObject *) PyCode_GetCode(PyCodeObject *code);
typedef enum _PyCodeLocationInfoKind {
/* short forms are 0 to 9 */