Support PyString_AsString() in Python 3 < 3.3
authorMichael Pratt <michael@pratt.im>
Fri, 8 Nov 2013 04:37:52 +0000 (23:37 -0500)
committerarc <arc@cthulhu.lan>
Fri, 8 Nov 2013 04:47:33 +0000 (23:47 -0500)
commit8aafd569c8420d6f05a644bfc72f07d64e22ecf2
treed7548e1ce0c5a6d5b68ea20f2de4bf47404ba274
parent254aece3173869216f447ba67f4919cc956c2722
Support PyString_AsString() in Python 3 < 3.3

In Python 3, version 3.3+, PyUnicode_AsUTF8() provides similar
functionality to Python 2's PyString_AsString().

In older versions of Python 3, there is no public function to provide
the same functionality.  However, the "internal" _PyUnicode_AsString()
does provide that functionality, so use it to replace
PyString_AsString().

With this patch, cv2 should compile for Python 3.[0-2].
modules/python/src2/pycompat.hpp