should be attribute error, not type error