Just do:

```
if parent_folder is old_parent_folder:
  break
```

Then you don't need at_root_folder at all.