From: Sage Weil Date: Thu, 20 Dec 2018 13:07:51 +0000 (-0600) Subject: mgr/PythonCompat: python 3 cludges X-Git-Tag: v14.1.0~532^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=425989ab18c3c9b708a7f72fec2a11ec62087d98;p=ceph.git mgr/PythonCompat: python 3 cludges Signed-off-by: Sage Weil --- diff --git a/src/mgr/PythonCompat.h b/src/mgr/PythonCompat.h index 7bbaf9c43cd1..4ffb2eee8a53 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