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:
parent
0ca676eb8c
commit
9aadd489c3
14 changed files with 163 additions and 1142 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue