From 7b570a15ae0dc8abb6149112e878021f7fbe299f Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 3 Mar 2016 12:08:11 +0100 Subject: [PATCH] Handle relative imports for Python 2. --- configure.ac | 5 ++++- cscripts/__init__.py.in | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index da38597..78f10ca 100644 --- a/configure.ac +++ b/configure.ac @@ -624,11 +624,14 @@ else # Set opening and closing symbols to make setup.py compatible for versions 2 and 3 if test ${PYTHON_VERSION} '<' 3; then - PYTHON_RELATIVE_IMPORT=" " + PYTHON_RELATIVE_IMPORT="" + PYTHON_FROM_DOT_="" else PYTHON_RELATIVE_IMPORT="." + PYTHON_FROM_DOT_="from . " fi AC_SUBST(PYTHON_RELATIVE_IMPORT) + AC_SUBST(PYTHON_FROM_DOT_) # Do we have distutils? AC_MSG_CHECKING([for the distutils Python package]) diff --git a/cscripts/__init__.py.in b/cscripts/__init__.py.in index 20ab4b3..2db1837 100644 --- a/cscripts/__init__.py.in +++ b/cscripts/__init__.py.in @@ -63,7 +63,7 @@ from @PYTHON_RELATIVE_IMPORT@cssens import cssens from @PYTHON_RELATIVE_IMPORT@csspec import csspec from @PYTHON_RELATIVE_IMPORT@cstsdist import cstsdist from @PYTHON_RELATIVE_IMPORT@cstsmapmerge import cstsmapmerge -from . import obsutils +@PYTHON_FROM_DOT_@import obsutils if cur_version > req_version: from @PYTHON_RELATIVE_IMPORT@csfindobs import csfindobs from @PYTHON_RELATIVE_IMPORT@csiactcopy import csiactcopy -- libgit2 0.21.4