python: Fix hook.