--- orig/__init__.py 2011-11-22 13:58:25.000000000 -0800 +++ patched/__init__.py 2011-11-22 14:03:14.000000000 -0800 @@ -1,3 +1,24 @@ +def _add_pyext_to_path(): + import os.path + import sys + # Get directory containing IMP's __init__.py + imp_dir = os.path.abspath(os.path.dirname(__file__)) + # Make sure we're on a Windows system + if hasattr(sys, 'dllhandle') and len(imp_dir) > 4: + # Strip '\IMP' suffix from directory + pydir = imp_dir[:-4] + # Add Python version-specific directory to search path + pyextdir = pydir + '\\python%d.%d' % sys.version_info[:2] + if pyextdir not in sys.path: + sys.path.insert(1, pyextdir) + # Strip '\python\IMP' suffix to get directory containing DLLs + dlldir = imp_dir[:-11] + '\\bin' + # Add DLL directory to PATH so Windows can find them + if dlldir not in os.environ['PATH']: + os.environ['PATH'] = dlldir + ';' + os.environ['PATH'] + +_add_pyext_to_path() + try: from kernel import * except: