only catch AttributeError in hasattr() #9666
5 files changed