comparison mercurial/demandimport.py @ 5156:0bbd86b847dd

demandimport: ignore resource module, not available under Windows.
author Patrick Mezard <pmezard@gmail.com>
date Tue, 14 Aug 2007 16:03:15 +0200
parents f4f2baf7dc8a
children
comparison
equal deleted inserted replaced
5155:f4f2baf7dc8a 5156:0bbd86b847dd
106 # set requested submodules for demand load 106 # set requested submodules for demand load
107 if not(hasattr(mod, x)): 107 if not(hasattr(mod, x)):
108 setattr(mod, x, _demandmod(x, mod.__dict__, locals)) 108 setattr(mod, x, _demandmod(x, mod.__dict__, locals))
109 return mod 109 return mod
110 110
111 ignore = ['_hashlib', '_xmlplus', 'fcntl', 'win32com.gen_py', 'pwd', 'grp'] 111 ignore = [
112 '_hashlib',
113 '_xmlplus',
114 'fcntl',
115 'win32com.gen_py',
116 # imported by tarfile, not available under Windows
117 'pwd',
118 'grp',
119 # imported by profile, itself imported by hotshot.stats,
120 # not available under Windows
121 'resource',
122 ]
112 123
113 def enable(): 124 def enable():
114 "enable global demand-loading of modules" 125 "enable global demand-loading of modules"
115 __builtins__["__import__"] = _demandimport 126 __builtins__["__import__"] = _demandimport
116 127