From 1a27732433773b7ff71f01628063748a54013ecd Mon Sep 17 00:00:00 2001 From: Stephan Gabler Date: Mon, 27 Jun 2011 10:41:49 +0200 Subject: [PATCH] fix the module import when linking to the git root instead of module for some application I need to link to the gensim folder which is also the root of the repository. This script helps python to find the actual sourcecode of the module and had to be changed because radim moved the source within the repo --- __init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 7e9a3c051d..156d7cf6ae 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,4 @@ # script by dedan: helps him to symlink gensim import os -modules_path = os.path.join('site-packages', 'gensim', 'gensim') -__path__.append(os.path.join(os.path.dirname(os.__file__), modules_path)) +dirname = __path__[0] # Package's main folder +__path__.insert(0, os.path.join(dirname, "gensim"))