mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
Fix VFSImporter for modules that change their sys.modules definition (such as 'Pmw' and 'panda3d')
This commit is contained in:
parent
808ca386c4
commit
bba6537f97
@ -143,15 +143,15 @@ class VFSLoader:
|
||||
if not code:
|
||||
raise ImportError, 'No Python code in %s' % (fullname)
|
||||
|
||||
mod = sys.modules.setdefault(fullname, new.module(fullname))
|
||||
mod = sys.modules.setdefault(fullname, imp.new_module(fullname))
|
||||
mod.__file__ = self.filename.toOsSpecific()
|
||||
mod.__loader__ = self
|
||||
if self.packagePath:
|
||||
mod.__path__ = [self.packagePath.toOsSpecific()]
|
||||
#print >> sys.stderr, "loaded %s, path = %s" % (fullname, mod.__path__)
|
||||
|
||||
exec code in mod.__dict__
|
||||
return mod
|
||||
exec(code, mod.__dict__)
|
||||
return sys.modules[fullname]
|
||||
|
||||
def getdata(self, path):
|
||||
path = Filename(self.dir_path, Filename.fromOsSpecific(path))
|
||||
@ -514,5 +514,4 @@ def reloadSharedPackages():
|
||||
continue
|
||||
|
||||
reloadSharedPackage(mod)
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user