Skip to content

Commit e6f5e5e

Browse files
committed
server: fix use of ensure_dir_exists in load_layout
1 parent 6531865 commit e6f5e5e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

py/visdom/server/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,13 @@ def load_layouts(self):
144144
RuntimeWarning
145145
)
146146
return ""
147-
layout_filepath = os.path.join(self.env_path, 'view', LAYOUT_FILE)
148-
ensure_dir_exists(layout_filepath)
147+
layout_dir = os.path.join(self.env_path, 'view')
148+
layout_filepath = os.path.join(layout_dir, LAYOUT_FILE)
149149
if os.path.isfile(layout_filepath):
150150
with open(layout_filepath, 'r') as fn:
151151
return fn.read()
152152
else:
153+
ensure_dir_exists(layout_dir)
153154
return ""
154155

155156
def load_state(self):

0 commit comments

Comments
 (0)