blob: d9d3efa24a28d73cbc7fbc24a49738f22c492ffd [file] [log] [blame]
#pragma once
#include <torch/csrc/utils/python_compat.h>
// Functions that need to be copied from the CPython source
// should go in cpython_defs.c. Copying is required when, e.g.,
// we need to call internal CPython functions that are not exposed.
#if IS_PYTHON_3_11_PLUS
#include <internal/pycore_frame.h>
int THP_PyFrame_FastToLocalsWithError(_PyInterpreterFrame* frame);
PyFunctionObject* _PyFunction_CopyWithNewCode(
PyFunctionObject* o,
PyCodeObject* code);
void THP_PyFrame_Clear(_PyInterpreterFrame* frame);
#endif