Rewrite the try, except clause so it only tests whether something is subscriptable