PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform == 'win32' and not PYTHONPATH):
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys, 'path_importer_cache', {})
stdpath = sys.path[len(PYTHONPATH):]
mydir = os.path.dirname(__file__)
if item == mydir or not item:
continue # skip if current dir. on Windows, or my own directory
loader = importer.find_module('site')
# This should actually reload the current module
loader.load_module('site')
import imp # Avoid import loop in Python >= 3.3
stream, path, descr = imp.find_module('site', [item])
# This should actually reload the current module
imp.load_module('site', stream, path, descr)
raise ImportError("Couldn't find the real 'site' module")
known_paths = dict([(makepath(item)[1], 1) for item in sys.path]) # 2.2 comp
oldpos = getattr(sys, '__egginsert', 0) # save old insertion position