Avoid taking a reference to sys.path at startup.

This fixes the behaviour of PyInstaller when sys.path is
rebound at runtime to a different list.


git-svn-id: http://svn.pyinstaller.org/trunk@770 8dd32b29-ccff-0310-8a9a-9233e24343b1
This commit is contained in:
giovannibajo
2010-02-11 00:23:39 +00:00
parent 02db2b8ff4
commit ac59ea060b
+3 -6
View File
@@ -271,10 +271,7 @@ class RegistryImportDirector(ImportDirector):
class PathImportDirector(ImportDirector):
def __init__(self, pathlist=None, importers=None, ownertypes=None):
if pathlist is None:
self.path = sys.path
else:
self.path = pathlist
self.path = pathlist
if ownertypes == None:
self.ownertypes = _globalownertypes
else:
@@ -287,11 +284,11 @@ class PathImportDirector(ImportDirector):
self.building = {}
def __str__(self):
return str(self.path)
return str(self.path or sys.path)
def getmod(self, nm):
mod = None
for thing in self.path:
for thing in (self.path or sys.path):
if isinstance(thing, STRINGTYPE):
owner = self.shadowpath.get(thing, -1)
if owner == -1: