swig/Examples/python/import_packages/relativeimport3/runme.py
Johan Hake 1dd297ad9d Fix issue with relative import when using single header file import.
-- The commit propagates the package option to the newly create
     module node so it is recognized by SWIG
  -- Added a relativeimport test for this combination
     (in lack of py3 I was not able to test it with py3 but it
      "should just work")
2014-08-12 21:48:26 +02:00

9 lines
293 B
Python

# Test import of modules content from within __init__.py
print "Testing %module(package=...) with -relativeimport"
import sys
if sys.version_info < (3,0):
import py2.pkg2.bar
print " Finished importing py2.pkg2.bar"
else:
import py3.pkg2.bar
print " Finished importing py3.pkg2.bar"