Python 3 attrgetter fix