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
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue