From 4bf7b440fefdec2bb752c7300fdccad66315b755 Mon Sep 17 00:00:00 2001 From: Benoit Boissinot Date: Thu, 14 Dec 2006 23:51:41 +0100 Subject: [PATCH] use parent.__setattr__ instead of __dict__ --- mercurial/demandimport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py index 3f13022373..1f4f06f7e9 100644 --- a/mercurial/demandimport.py +++ b/mercurial/demandimport.py @@ -35,8 +35,8 @@ class _demandmod(object): else: head = name after = [] - self.__dict__["_data"] = (head, globals, locals, after) - self.__dict__["_module"] = None + object.__setattr__(self, "_data", (head, globals, locals, after)) + object.__setattr__(self, "_module", None) def _extend(self, name): """add to the list of submodules to load""" self._data[3].append(name) @@ -54,7 +54,7 @@ class _demandmod(object): # are we in the locals dictionary still? if locals and locals.get(head) == self: locals[head] = mod - self.__dict__["_module"] = mod + object.__setattr__(self, "_module", mod) def __repr__(self): return "" % self._data[0] def __call__(self, *args, **kwargs):