Skip to content

Commit

Permalink
server: fix use of ensure_dir_exists in load_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hartmann authored and JackUrb committed Oct 21, 2022
1 parent dbff1d7 commit 88eb387
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py/visdom/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ def load_layouts(self):
RuntimeWarning
)
return ""
layout_filepath = os.path.join(self.env_path, 'view', LAYOUT_FILE)
ensure_dir_exists(layout_filepath)
layout_dir = os.path.join(self.env_path, 'view')
layout_filepath = os.path.join(layout_dir, LAYOUT_FILE)
if os.path.isfile(layout_filepath):
with open(layout_filepath, 'r') as fn:
return fn.read()
else:
ensure_dir_exists(layout_dir)
return ""

def load_state(self):
Expand Down

0 comments on commit 88eb387

Please sign in to comment.