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

Avoid unnecessary isfile/exists calls #14527

Merged
merged 2 commits into from
Jan 4, 2024

Conversation

akx
Copy link
Collaborator

@akx akx commented Jan 3, 2024

Description

No need to do an extra syscall to figure out if a file is a file or if it exists if we can just catch a FileNotFoundError or similar.

Also kind of avoids a couple possible TOCTOU races.

Screenshots/videos:

Nope

Checklist:

@akx akx marked this pull request as ready for review January 3, 2024 22:28
@AUTOMATIC1111 AUTOMATIC1111 merged commit 397251b into AUTOMATIC1111:dev Jan 4, 2024
3 checks passed
@w-e-w w-e-w mentioned this pull request Feb 17, 2024
@pawel665j pawel665j mentioned this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants