Determine plugin_path from the location of the plugin module, not from argv[0].
authorMarien Zwart <marienz@gentoo.org>
Wed, 5 Apr 2006 15:41:21 +0000 (17:41 +0200)
committerMarien Zwart <marienz@gentoo.org>
Wed, 5 Apr 2006 15:41:21 +0000 (17:41 +0200)
libbe/plugin.py

index b175733a41d1fa74143532b8b39332ff6b10a922..4016ca1ffc3e1d5aa67b36d2f0cc1d644fd9be34 100644 (file)
@@ -52,9 +52,7 @@ def get_plugin(prefix, name):
         return my_import(prefix + "." + name)
     return None
 
-plugin_path = sys.path[0]
-while not os.path.isfile(os.path.join(plugin_path, "libbe/plugin.py")):
-    plugin_path = os.path.realpath(os.path.dirname(plugin_path))
+plugin_path = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
 if plugin_path not in sys.path:
     sys.path.append(plugin_path)
 def _test():