Skip to content

Commit

Permalink
fix _create_json_file
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalinve committed Oct 29, 2024
1 parent ac6feb0 commit 0fd834a
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/ansys/aedt/core/generic/general_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1333,17 +1333,10 @@ def _create_json_file(json_dict, full_json_path):
if not os.path.exists(os.path.dirname(full_json_path)):
os.makedirs(os.path.dirname(full_json_path))

temp_path = full_json_path.replace(".json", "_temp.json")
with open_file(temp_path, "w") as fp:
with open_file(full_json_path, "w") as fp:
json.dump(json_dict, fp, indent=4)
with open_file(temp_path, "r") as file:
filedata = file.read()
filedata = filedata.replace("True", "true")
filedata = filedata.replace("False", "false")
with open_file(full_json_path, "w") as file:
file.write(filedata)
os.remove(temp_path)
settings.logger.info(f"{full_json_path} correctly created.")

return True


Expand Down

0 comments on commit 0fd834a

Please sign in to comment.