diff options
author | Sage Weil <sage@redhat.com> | 2018-12-20 14:07:51 +0100 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2018-12-21 05:11:37 +0100 |
commit | 425989ab18c3c9b708a7f72fec2a11ec62087d98 (patch) | |
tree | 981acc3d3f92536bc9e73698af9c4688bc96f8c6 /src | |
parent | pybind/mgr/mgr_module: make use of defined default value (diff) | |
download | ceph-425989ab18c3c9b708a7f72fec2a11ec62087d98.tar.xz ceph-425989ab18c3c9b708a7f72fec2a11ec62087d98.zip |
mgr/PythonCompat: python 3 cludges
Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mgr/PythonCompat.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 <Python.h> @@ -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 |