patched with a patch I got from a student, I guess Blender community. It fixes some things with python3 and has better syntax for type checking
no idea who did it