Merge pull request #1767 from prattmic:python3_asstring

pull/1781/merge
Roman Donchenko 11 years ago committed by OpenCV Buildbot
commit 469d7eed72
  1. 8
      modules/python/src2/pycompat.hpp

@ -56,9 +56,15 @@
// Python3 strings are unicode, these defines mimic the Python2 functionality. // Python3 strings are unicode, these defines mimic the Python2 functionality.
#define PyString_Check PyUnicode_Check #define PyString_Check PyUnicode_Check
#define PyString_FromString PyUnicode_FromString #define PyString_FromString PyUnicode_FromString
#define PyString_AsString PyUnicode_AsUTF8
#define PyString_FromStringAndSize PyUnicode_FromStringAndSize #define PyString_FromStringAndSize PyUnicode_FromStringAndSize
#define PyString_Size PyUnicode_GET_SIZE #define PyString_Size PyUnicode_GET_SIZE
// PyUnicode_AsUTF8 isn't available until Python 3.3
#if (PY_VERSION_HEX < 0x03030000)
#define PyString_AsString _PyUnicode_AsString
#else
#define PyString_AsString PyUnicode_AsUTF8
#endif
#endif #endif
#endif // END HEADER GUARD #endif // END HEADER GUARD

Loading…
Cancel
Save