Oh, my mistake, `os` *is* used. But `microsite_root` is a path.py object, so you can just call `if microsite_root.isdir():` That's not only shorter and more readable, but it allows you to avoid importing `os` at all.