999
999
self.addCleanup(self._restoreHooks)
1000
1000
for key, (parent, name) in known_hooks.iter_parent_objects():
1001
1001
factory = known_hooks.get(key)
1002
setattr(parent, name, factory(key[0], key[1]))
1003
1003
# this hook should always be installed