changeset 1841:7f12a63568ae

Fix py2exe packagescan problem with new demandload
author Eung-ju Park <eungju@gmail.com>
date Mon, 06 Mar 2006 10:49:34 -0800
parents cd5c1db2132a
children eff3496d153d
files mercurial/packagescan.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/packagescan.py	Sun Mar 05 01:37:28 2006 -0800
+++ b/mercurial/packagescan.py	Mon Mar 06 10:49:34 2006 -0800
@@ -16,8 +16,14 @@
     """ fake demandload function that collects the required modules """
     for m in modules.split():
         mod = None
-        mod = __import__(m,scope,scope)
-        scope[m] = mod
+        try:
+            module, submodules = m.split(':')
+            submodules = submodules.split(',')
+        except:
+            module = m
+            submodules = []
+        mod = __import__(module, scope, scope, submodules)
+        scope[module] = mod
         requiredmodules[mod.__name__] = 1
 
 def getmodules(libpath,packagename):