Handle unrecognised options correctly.
# HG changeset patch
# User Bryan O'Sullivan <bos@serpentine.com>
# Node ID
837a023781a0228e5791e8e278129d2d54d13f99
# Parent
d2994b5298fb20f87dc1d4747635b280db3c0526
Handle unrecognised options correctly.
def demandload(scope, modules):
class d:
def __getattr__(self, name):
mod = self.__dict__["mod"]
scope = self.__dict__["scope"]
scope[mod] = __import__(mod, scope, scope, [])
return getattr(scope[mod], name)
for m in modules.split():
dl = d()
dl.mod = m
dl.scope = scope
scope[m] = dl