Skip to content

Commit

Permalink
fix: _write_definitions Permission denied
Browse files Browse the repository at this point in the history
  • Loading branch information
jwindgassen committed Nov 30, 2022
1 parent decf556 commit 80a8579
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pv_visualizer/app/engine/proxymanager/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,13 @@ def _write_definition(self, proxy_type, extension, content):
Path(self._write_definitions_base)
/ f"{'/'.join(proxy_type.split('__'))}.{extension}"
)
os.makedirs(file_name.parent, exist_ok=True)
with open(file_name, "w") as file:
file.write(content)

try:
os.makedirs(file_name.parent, exist_ok=True)
with open(file_name, "w") as file:
file.write(content)
except PermissionError: # Write-protection
pass

def _proxy_ensure_definition(self, proxy):
proxy_type = definitions.proxy_type(proxy)
Expand Down

0 comments on commit 80a8579

Please sign in to comment.