Skip to content

Commit

Permalink
Use exist_ok flag instead of redundant if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
du33169 committed Oct 28, 2024
1 parent acb61e2 commit 3a47a5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions babel/messages/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ def finalize_options(self):
self.output_file = os.path.join(self.output_dir, self.locale,
'LC_MESSAGES', f"{self.domain}.po")

if not os.path.exists(os.path.dirname(self.output_file)):
os.makedirs(os.path.dirname(self.output_file))
os.makedirs(os.path.dirname(self.output_file),exist_ok=True)

if self.no_wrap and self.width:
raise OptionError("'--no-wrap' and '--width' are mutually exclusive")
if not self.no_wrap and not self.width:
Expand Down

0 comments on commit 3a47a5c

Please sign in to comment.