Author: tack
Date: Thu Mar 13 13:47:47 2008
New Revision: 3188
Log:
Don't assume first element in sys.path is always cwd, and don't assume it
is the only one.
Modified:
trunk/base/src/utils.py
Modified: trunk/base/src/utils.py
==============================================================================
--- trunk/base/src/utils.py (original)
+++ trunk/base/src/utils.py Thu Mar 13 13:47:47 2008
@@ -294,7 +294,12 @@
return sys.modules[name]
except KeyError:
pass
- fp, pathname, description = imp.find_module(name, sys.path[1:])
+
+ # Remove the current directory and anything below it from the
+ # search path.
+ cwd = os.path.realpath(os.getcwd())
+ path = [ x for x in sys.path if x and not
os.path.realpath(x).startswith(cwd) ]
+ fp, pathname, description = imp.find_module(name, path)
try:
return imp.load_module(name, fp, pathname, description)
finally:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog