From 4b3ac41e7c27ed2403eaa33e7c4e3b3252b0e4a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:49:04 +0000 Subject: [PATCH] style: pre-commit fixes --- include/pybind11/pybind11.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index f87b2bd402..df543811fc 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -2751,11 +2751,11 @@ get_type_override(const void *this_ptr, const type_info *this_type, const char * if ((std::string) str(f_code->co_name) == name && f_code->co_argcount > 0) { PyObject *locals = PyEval_GetLocals(); if (locals != nullptr) { -# if PY_VERSION_HEX >= 0x03110000 +# if PY_VERSION_HEX >= 0x03110000 PyObject *co_varnames = PyCode_GetVarnames(f_code); -# else +# else PyObject *co_varnames = PyObject_GetAttrString((PyObject *) f_code, "co_varnames"); -# endif +# endif PyObject *self_arg = PyTuple_GET_ITEM(co_varnames, 0); Py_DECREF(co_varnames); PyObject *self_caller = dict_getitem(locals, self_arg);