Fix im_class access in Python 3.