Commit 7b570a15ae0dc8abb6149112e878021f7fbe299f

Authored by Jürgen Knödlseder
1 parent 30daf3a5

Handle relative imports for Python 2.

configure.ac
... ... @@ -624,11 +624,14 @@ else
624 624  
625 625 # Set opening and closing symbols to make setup.py compatible for versions 2 and 3
626 626 if test ${PYTHON_VERSION} '<' 3; then
627   - PYTHON_RELATIVE_IMPORT=" "
  627 + PYTHON_RELATIVE_IMPORT=""
  628 + PYTHON_FROM_DOT_=""
628 629 else
629 630 PYTHON_RELATIVE_IMPORT="."
  631 + PYTHON_FROM_DOT_="from . "
630 632 fi
631 633 AC_SUBST(PYTHON_RELATIVE_IMPORT)
  634 + AC_SUBST(PYTHON_FROM_DOT_)
632 635  
633 636 # Do we have distutils?
634 637 AC_MSG_CHECKING([for the distutils Python package])
... ...
cscripts/__init__.py.in
... ... @@ -63,7 +63,7 @@ from @PYTHON_RELATIVE_IMPORT@cssens import cssens
63 63 from @PYTHON_RELATIVE_IMPORT@csspec import csspec
64 64 from @PYTHON_RELATIVE_IMPORT@cstsdist import cstsdist
65 65 from @PYTHON_RELATIVE_IMPORT@cstsmapmerge import cstsmapmerge
66   -from . import obsutils
  66 +@PYTHON_FROM_DOT_@import obsutils
67 67 if cur_version > req_version:
68 68 from @PYTHON_RELATIVE_IMPORT@csfindobs import csfindobs
69 69 from @PYTHON_RELATIVE_IMPORT@csiactcopy import csiactcopy
... ...