Old small python script to work in blender 2.78

Hi, I find a script for blender to add selected bones to a keying set but it doesn’t work throwing some errors.
Can someone help me converting it to work with blender 2.78 ?

Thanks in advance.

Sorry , in fact it work, I was just not in the good mode !