Fix #15862 remove dirs in keep list when walk path

Yes, these two is almost the same, the last one have extra `LOAD_NAME` and `STORE_SLICE+0` steps.

But I think put `list comprehension` as a single statement is more readability :)