CLN: Use 'getattr' instead of 'hasattr' checks.