respect abstract paths in `patch_class` (see #3500)