]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/PythonCompat: python 3 cludges
authorSage Weil <sage@redhat.com>
Thu, 20 Dec 2018 13:07:51 +0000 (07:07 -0600)
committerSage Weil <sage@redhat.com>
Fri, 21 Dec 2018 04:11:37 +0000 (22:11 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/PythonCompat.h

index 7bbaf9c43cd146adbc313cc478ccc13952ba62c4..4ffb2eee8a53e470514c543b398e34e56a4e8eca 100644 (file)
@@ -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