Skip to content

Prefer exist_ok=True in makedirs instead of try-catch#2440

Open
Avasam wants to merge 3 commits intomhammond:mainfrom
Avasam:prefer-exist_ok=True
Open

Prefer exist_ok=True in makedirs instead of try-catch#2440
Avasam wants to merge 3 commits intomhammond:mainfrom
Avasam:prefer-exist_ok=True

Conversation

@Avasam
Copy link
Collaborator

@Avasam Avasam commented Dec 15, 2024

Use of exist_ok=True in os.makedirs instead of try-catch.

I left the one in adodbapi since it's detecting existing folder to print a note.

@Avasam Avasam requested a review from mhammond December 15, 2024 00:41
# os.mkdir(win32com.__gen_path__)
except OSError:
pass
os.makedirs(win32com.__gen_path__, exist_ok=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduces changes in #1675

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.

1 participant