diff --git a/configure.ac b/configure.ac index 66fb43f..59ba4ab 100644 --- a/configure.ac +++ b/configure.ac @@ -624,14 +624,11 @@ else # Set opening and closing symbols to make setup.py compatible for versions 2 and 3 if test ${PYTHON_VERSION} '<' 3; then - PYTHON_OPEN=" " - PYTHON_CLOSE="" + PYTHON_RELATIVE_IMPORT=" " else - PYTHON_OPEN="(" - PYTHON_CLOSE=")" + PYTHON_RELATIVE_IMPORT="." fi - AC_SUBST(PYTHON_OPEN) - AC_SUBST(PYTHON_CLOSE) + AC_SUBST(PYTHON_RELATIVE_IMPORT) # Do we have distutils? AC_MSG_CHECKING([for the distutils Python package]) diff --git a/pyext/ctools/__init__.py.in b/pyext/ctools/__init__.py.in index 57a41a0..9ca877e 100644 --- a/pyext/ctools/__init__.py.in +++ b/pyext/ctools/__init__.py.in @@ -21,12 +21,7 @@ import gammalib # Import sub modules -#from .tools import * -import sys -if sys.version_info[0] < 3: - from tools import * -else: - from .tools import * +from @PYTHON_RELATIVE_IMPORT@tools import * # Remove swig register stuff bad_entries = [entry for entry in list(locals())