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
9 changed files with 9 additions and 17 deletions

View File

@@ -492,8 +492,7 @@ def setup_platform(
offset: datetime.timedelta = config[CONF_OFFSET]
include_tomorrow = config[CONF_TOMORROW]
if not os.path.exists(gtfs_dir):
os.makedirs(gtfs_dir)
os.makedirs(gtfs_dir, exist_ok=True)
if not os.path.exists(os.path.join(gtfs_dir, data)):
_LOGGER.error("The given GTFS data file/folder was not found")