diff --git a/mozilla/extensions/python/xpcom/server/loader.py b/mozilla/extensions/python/xpcom/server/loader.py index a7018049348..1103d6ff1e2 100644 --- a/mozilla/extensions/python/xpcom/server/loader.py +++ b/mozilla/extensions/python/xpcom/server/loader.py @@ -18,7 +18,6 @@ import xpcom from xpcom import components -import factory import module import glob, os, types @@ -65,6 +64,7 @@ class PythonComponentLoader: def __init__(self): self.com_modules = {} # Keyed by module's FQN as obtained from nsIFile.path + self.moduleFactory = module.Module def _getCOMModuleForLocation(self, componentFile): fqn = componentFile.path @@ -82,7 +82,7 @@ class PythonComponentLoader: # Make and remember the COM module. comps = FindCOMComponents(py_mod) - mod = module.Module(comps) + mod = self.moduleFactory(comps) self.com_modules[fqn] = mod return mod diff --git a/mozilla/extensions/python/xpcom/server/module.py b/mozilla/extensions/python/xpcom/server/module.py index 841f53864c9..caa9cd5076e 100644 --- a/mozilla/extensions/python/xpcom/server/module.py +++ b/mozilla/extensions/python/xpcom/server/module.py @@ -31,6 +31,7 @@ class Module: c = self.components = {} for klass in comps: c[components.ID(klass._reg_clsid_)] = klass + self.klassFactory = factory.Factory def getClassObject(self, compMgr, clsid, iid): # Single retval result. @@ -39,8 +40,8 @@ class Module: except KeyError: raise ServerException(nsError.NS_ERROR_FACTORY_NOT_REGISTERED) - # We can ignore the IID - the auto-wrapp process will automatically QI us. - return factory.Factory(klass) + # We can ignore the IID - the auto-wrap process will automatically QI us. + return self.klassFactory(klass) def registerSelf(self, compMgr, location, loaderStr, componentType): # void function.