Fix for running 'python -m' when using swig -builtin

Same as e05b5ea for -builtin.

Also added runtime tests to check 'python -m'.
This commit is contained in:
William S Fulton 2018-12-04 19:12:13 +00:00
commit 604ae7186b
17 changed files with 155 additions and 9 deletions

View file

@ -1,4 +1,6 @@
import os.path
import subprocess
import sys
testname = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
print "Testing " + testname + " - %module(package=...) + python 'import' in __init__.py"
@ -12,3 +14,7 @@ classname = str(type(var2))
if classname.find("pkg1.pkg2.foo.Pkg2_Foo") == -1:
raise RuntimeError("failed type checking: " + classname)
print " Successfully created object pkg1.pkg2.foo.Pkg2_Foo"
commandline = sys.executable + " -m pkg1.pkg2.foo"
subprocess.check_call(commandline, shell=True)
print(" Finished running: " + commandline)