summaryrefslogtreecommitdiff
path: root/Examples/python/import_packages/same_modnames2
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2018-12-04 19:12:13 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2018-12-04 19:12:13 +0000
commit604ae7186bcd9d5b8a2b781d5dcf9d52c0c759a3 (patch)
treec7f4547475c4e28a9feb5825e86c5b271ce2e86c /Examples/python/import_packages/same_modnames2
parent9e83d5d5d9c65234f461c0cb6e04e4c9641b53dd (diff)
downloadswig-604ae7186bcd9d5b8a2b781d5dcf9d52c0c759a3.tar.gz
Fix for running 'python -m' when using swig -builtin
Same as e05b5ea for -builtin. Also added runtime tests to check 'python -m'.
Diffstat (limited to 'Examples/python/import_packages/same_modnames2')
-rw-r--r--Examples/python/import_packages/same_modnames2/runme.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Examples/python/import_packages/same_modnames2/runme.py b/Examples/python/import_packages/same_modnames2/runme.py
index 55f6826b9..cc1370286 100644
--- a/Examples/python/import_packages/same_modnames2/runme.py
+++ b/Examples/python/import_packages/same_modnames2/runme.py
@@ -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)