From 1815936b7d4473fca51abe967fb8de5a34495e90 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 18 Jul 2016 19:47:36 +0200 Subject: [PATCH] Fix import error when PYTHONPATH is not set. --- docs/src/conf.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/conf.py b/docs/src/conf.py index dee11095..463bcedd 100644 --- a/docs/src/conf.py +++ b/docs/src/conf.py @@ -15,7 +15,6 @@ import sys import os -import cdist.version import sphinx_rtd_theme # If extensions (or modules to document with autodoc) are in another directory, @@ -23,7 +22,11 @@ import sphinx_rtd_theme # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath(os.path.join( - os.path.dirname(os.path.realpath(__file__)), "../../"))) + os.path.dirname(os.path.realpath(__file__)), "..", ".."))) + +# Import cdist after sys.path fixup above. + +import cdist.version # nopep8 - ignore error that import is not at top # -- General configuration ------------------------------------------------