Only test python:abc feature when passing -py3 to swig

This commit is contained in:
William S Fulton 2016-06-06 19:10:25 +01:00
commit 2d5c32048c
2 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,10 @@ from collections import *
if is_python_builtin():
exit(0)
# Python abc is only turned on when -py3 option is passed to SWIG
if not is_swig_py3:
exit(0)
assert issubclass(Mapii, MutableMapping)
assert issubclass(Multimapii, MutableMapping)
assert issubclass(IntSet, MutableSet)

View file

@ -24,3 +24,9 @@ bool is_python_builtin() { return true; }
bool is_python_builtin() { return false; }
#endif
%}
#ifdef SWIGPYTHON_PY3 // set when using -py3
#define is_swig_py3 1
#else
#define is_swig_py3 0
#endif