fix pid file not there on first run so exception was thrown and not caught

when the user ran the web ui for the first time. the running_pid file was not created yet by the server so it threw an exception due to with open not inside the try block
This commit is contained in:
Ziad-I
2024-07-30 18:18:35 +03:00
parent 6012695cfe
commit 51463ab674
+1 -1
View File
@@ -227,8 +227,8 @@ class Web(blenderbim.core.tool.Web):
return False return False
webui_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "webui") webui_path = os.path.join(bpy.context.scene.BIMProperties.data_dir, "webui")
pid_file = os.path.join(webui_path, "running_pid.json") pid_file = os.path.join(webui_path, "running_pid.json")
with open(pid_file, "r") as f:
try: try:
with open(pid_file, "r") as f:
data = json.load(f) data = json.load(f)
if port in data.values(): if port in data.values():
return True return True