Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifdef PYTHON3
- %typemap(typecheck) const char*
- {
- $1 = PyUnicode_Check($input);
- }
- %typemap(in) const char*
- {
- if(PyUnicode_Check($input))
- {
- $1 = PyBytes_AsString(PyUnicode_AsASCIIString(const_cast<PyObject*>($input)));
- }
- else { SWIG_fail; }
- }
- %typemap(freearg) const char*
- {
- // pass
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement