swig/Examples/python/import_packages/same_modnames1/runme.py
William S Fulton 4fb940d913 Further fixes when using type() when using -builtin to include module name
Using type() on a builtin type should include the package and module
name, see http://docs.python.org/2/c-api/typeobj.html
2014-03-01 23:26:27 +00:00

9 lines
395 B
Python

# Test import of same modules from different packages
print "Testing %module(package=...) + %import + same modules in different packages"
import pkg2.foo
print " Finished importing pkg2.foo"
var2 = pkg2.foo.Pkg2_Foo()
if str(type(var2)).find("'pkg2.foo.Pkg2_Foo'") == -1:
raise RuntimeError("failed type checking: " + str(type(var2)))
print " Successfully created object pkg2.foo.Pkg2_Foo"