Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if folders exist before trying to delete them #5

Open
ledigchr opened this issue Dec 18, 2017 · 1 comment
Open

Check if folders exist before trying to delete them #5

ledigchr opened this issue Dec 18, 2017 · 1 comment
Labels

Comments

@ledigchr
Copy link
Collaborator

Check that output folders exist before trying to delete them. Only relevant when --cleanup is used. Does not influence results, but can cause an error during the final cleanup.

@ledigchr ledigchr added the bug label Dec 18, 2017
@schuhschuh
Copy link
Member

Alternatively, no need to query file system twice, just catch exception:

def try_rmdir(path):
    try:
        os.rmdir(path)
    except IOError:
        pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants