mirror of
https://github.com/kennethreitz-archive/pyinstaller.git
synced 2026-06-05 23:50:17 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user