Remove unnecessary checks before calling os.makedirs (#62576)

This commit is contained in:
Erik Montnemery 2021-12-23 09:59:31 +01:00 committed by GitHub
parent 1edfa2d426
commit cb2c2d98c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 9 additions and 17 deletions

View file

@ -1299,8 +1299,7 @@ async def test_homekit_uses_system_zeroconf(hass, hk_driver, mock_async_zeroconf
def _write_data(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)
json_util.save_json(path, data)