Remove unnecessary checks before calling os.makedirs (#62576)
This commit is contained in:
parent
1edfa2d426
commit
cb2c2d98c3
9 changed files with 9 additions and 17 deletions
|
@ -277,8 +277,7 @@ class Store:
|
|||
|
||||
def _write_data(self, path: str, data: dict) -> None:
|
||||
"""Write the data."""
|
||||
if not os.path.isdir(os.path.dirname(path)):
|
||||
os.makedirs(os.path.dirname(path))
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
|
||||
_LOGGER.debug("Writing data for %s to %s", self.key, path)
|
||||
json_util.save_json(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue