1000
1000
for key, (parent, name) in known_hooks.iter_parent_objects():
1001
1001
current_hooks = getattr(parent, name)
1002
1002
self._preserved_hooks[parent] = (name, current_hooks)
1003
1005
self.addCleanup(self._restoreHooks)
1004
1006
for key, (parent, name) in known_hooks.iter_parent_objects():
1005
1007
factory = known_hooks.get(key)