Python 3 compatibility: apply no longer exists