Skip to content

Commit

Permalink
Changed the bug fix to adding an if statement to check if filename en…
Browse files Browse the repository at this point in the history
…ds with '.json'.
  • Loading branch information
liggett2820 committed Aug 2, 2022
1 parent 5407e4d commit 5b04dbf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 3 additions & 1 deletion atef/widgets/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ def save_as(self, *args, filename: Optional[str] = None, **kwargs):
caption='Save as',
filter='Json Files (*.json)',
)
if filename.endswith('.json') is False: # json_extension_bug_fix location
filename += '.json'
try:
with open(filename+'.json', 'w') as fd: ## json_extension_bug_fix location
with open(filename, 'w') as fd:
json.dump(serialized, fd, indent=2)
except OSError:
logger.exception(f'Error saving file {filename}')
Expand Down
3 changes: 0 additions & 3 deletions demo-configs/my_filename.json.json

This file was deleted.

0 comments on commit 5b04dbf

Please sign in to comment.