cubicweb #531967 migration script can't deactivate hooks [deprecated]

Bulk import optimization is normally possible by deactivate hooks in migration scripts by:

from cubes.keyword import hooks
repo.hm.unregister_hook(hooks.SetIncludedInRelationHook)
repo.hm.deactivate_verification_hooks()

But I got this traceback:

File "/home/juj/src/fcubicweb/cubicweb/server/migractions.py", line 109, in cmd_process_script
  migrscript, funcname, *args, **kwargs)
File "/home/juj/src/fcubicweb/cubicweb/common/migration.py", line 280, in cmd_process_script
  execfile(migrscript, scriptlocals)
File "/home/juj/src/fcubicweb/cubes/codenaf/migration/postcreate.py", line 13, in <module>
  process_script(os.path.join(codenaf.__path__[0], 'bin/import-naf-from-dbf.py'))
File "/home/juj/src/fcubicweb/cubicweb/common/migration.py", line 120, in <lambda>
  meth=meth)
File "/home/juj/src/fcubicweb/cubicweb/common/migration.py", line 186, in interact
  return meth(*args, **kwargs)
File "/home/juj/src/fcubicweb/cubicweb/server/migractions.py", line 109, in cmd_process_script
  migrscript, funcname, *args, **kwargs)
File "/home/juj/src/fcubicweb/cubicweb/common/migration.py", line 280, in cmd_process_script
  execfile(migrscript, scriptlocals)
File "/home/juj/src/fcubicweb/cubes/codenaf/bin/import-naf-from-dbf.py", line 30, in <module>
  repo.hm.deactivate_verification_hooks()
File "/home/juj/src/fcubicweb/cubicweb/server/hooksmanager.py", line 172, in deactivate_verification_hooks
  self.unregister_hook(cardinalitycheck_after_add_entity, 'after_add_entity', '')
File "/home/juj/src/fcubicweb/cubicweb/server/hooksmanager.py", line 108, in unregister_hook
  self._hooks[event][etype].remove(function_or_cls)
ValueError: list.remove(x): x not in list
prioritynormal
typebug
done in3.6.0
load0.000
load left0.000
closed by<not specified>