swig/Examples/python/import_packages/same_modnames2/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

7 lines
283 B
Python

import pkg1.pkg2.foo
print " Finished importing pkg1.pkg2.foo"
var2 = pkg1.pkg2.foo.Pkg2_Foo();
if str(type(var2)).find("'pkg1.pkg2.foo.Pkg2_Foo'") == -1:
raise RuntimeError("failed type checking: " + str(type(var2)))
print " Successfully created object pkg1.pkg2.foo.Pkg2_Foo"