Python3 ready. Py2.7 and Py3 working. Drop PyCObject for all.

Pre Py2.7 support should be possible by including  "capsulethunk.h". (See llvm/wrap.h)
This commit is contained in:
Siu Kwan Lam 2012-07-26 15:25:23 -07:00
commit 9aadd489c3
14 changed files with 163 additions and 1142 deletions

View file

@ -77,3 +77,22 @@ def wrapiter(first, next, container, wrapper):
ptr = next(ptr)
return ret
#===----------------------------------------------------------------------===
# Py2/3 compatibility string check
#===----------------------------------------------------------------------===
def _isstring_py2(x):
return isinstance(x, basestring)
def _isstring_py3(x):
return isinstance(x, str)
def _isstring_choose():
try:
basestring
return _isstring_py2
except:
return _isstring_py3
isstring = _isstring_choose()