2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-24 06:02:14 +00:00

clean other attempts for making unicode -> const char* conversion work, since now we have the right way in previous commit.

[SVN r53693]
This commit is contained in:
Haoyu Bai
2009-06-06 14:51:35 +00:00
parent 6fe34b46d4
commit eea11df1ea
2 changed files with 0 additions and 51 deletions

View File

@@ -62,35 +62,6 @@ struct arg_from_python<PyObject* const&>
PyObject* m_source;
};
#if PY_VERSION_HEX >= 0x03000000
// specialization for const char *, experimenting
template <>
struct arg_from_python<const char*>
{
typedef const char* result_type;
arg_from_python(PyObject* p) : m_source(p), intermediate(0) {}
bool convertible() const
{
return PyUnicode_Check(m_source);
}
const char* operator()()
{
const char* result;
intermediate = PyUnicode_AsUTF8String(m_source);
result = PyBytes_AsString(intermediate);
return result;
}
~arg_from_python()
{
Py_DECREF(intermediate);
}
private:
PyObject* m_source;
PyObject* intermediate;
};
#endif
//
// implementations
//