swig/Examples/python/import_packages/namespace_pkg/runme.py
William S Fulton 89bee6a7fa Modify examples to be both Python 2 and 3 compatible
For removing dependency on 2to3
2020-08-15 16:46:01 +01:00

18 lines
445 B
Python

# These examples rely on namespace packages. Don't
# run them for old python interpreters.
import os.path
import subprocess
import sys
testname = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
print("Testing " + testname + " - namespace packages")
if sys.version_info < (3, 3, 0):
print(" Not importing nstest as Python version is < 3.3")
sys.exit(0)
import nstest
print(" Finished importing nstest")
nstest.main()