bpo-35444: Fix error handling when fail to look up builtin "getattr". (GH-11047) (GH-11107)

(cherry picked from commit bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d)
7 files changed