Fixed SafeEyes not being able to run on ubuntu 20.04 LTS

This commit is contained in:
adventuretc 2024-01-19 18:35:58 +01:00
parent 0e2a13110f
commit 756e2f641d
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,9 @@ def init(ctx, safeeyes_config, plugin_config):
'total_resets': 0,
}
session = context['session']['plugin'].get('healthstats', {}) | defaults
# session = context['session']['plugin'].get('healthstats', {}) | defaults
session = context['session']['plugin'].get('healthstats', {}).copy()
session.update(defaults) # refactored to maintain compatibility with python3.8 on Ubuntu 20.04 LTS (dict | dict syntax was introduced in python3.9).
if 'no_of_breaks' in session:
# Ignore old format session.
session = defaults