fix import path issues when running from a symlink
diff --git a/oft b/oft
index f17d485..439bae8 100755
--- a/oft
+++ b/oft
@@ -117,7 +117,9 @@
import imp
import random
-pydir = os.path.join(os.path.dirname(__file__), 'src', 'python')
+root_dir = os.path.dirname(os.path.realpath(__file__))
+
+pydir = os.path.join(root_dir, 'src', 'python')
if os.path.exists(os.path.join(pydir, 'oftest')):
# Running from source tree
sys.path.insert(0, pydir)
@@ -151,8 +153,6 @@
_debug_default = "warning"
_debug_level_default = DEBUG_LEVELS[_debug_default]
-root_dir = os.path.dirname(__file__)
-
##@var config_default
# The default configuration dictionary for OFT
config_default = {