From 425989ab18c3c9b708a7f72fec2a11ec62087d98 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 20 Dec 2018 07:07:51 -0600 Subject: [PATCH] mgr/PythonCompat: python 3 cludges Signed-off-by: Sage Weil --- src/mgr/PythonCompat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mgr/PythonCompat.h b/src/mgr/PythonCompat.h index 7bbaf9c43cd..4ffb2eee8a5 100644 --- a/src/mgr/PythonCompat.h +++ b/src/mgr/PythonCompat.h @@ -1,3 +1,6 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + #pragma once #include @@ -25,4 +28,11 @@ inline PyObject* PyInt_FromLong(long ival) { inline int PyString_Check(PyObject *o) { return PyUnicode_Check(o); } +inline PyObject* PyFloat_FromString(PyObject *s, void *arg) { + return PyFloat_FromString(s); +} +inline PyObject* PyInt_FromString(const char *str, char **pend, int base) { + return PyLong_FromString(str, pend, base); +} +#define PyString_Type PyUnicode_Type #endif -- 2.39.5