| 114 | } |
| 115 | |
| 116 | std::string PyStringAsString(PyObject* obj) { |
| 117 | PyObject* bytes = PyUnicode_AsEncodedString(obj, "utf-8", "~E~"); |
| 118 | std::string str = PyBytes_AS_STRING(bytes); |
| 119 | Py_XDECREF(bytes); |
| 120 | return str; |
| 121 | } |
| 122 | |
| 123 | std::string PyObjectToReprStr(PyObject* obj) { |
| 124 | PyObject* repr_obj = PyObject_Repr(obj); |
no outgoing calls
no test coverage detected