--- a/src/eric7/Preferences/ShortcutsFile.py Thu Jul 28 19:44:54 2022 +0200 +++ b/src/eric7/Preferences/ShortcutsFile.py Fri Jul 29 16:29:31 2022 +0200 @@ -144,15 +144,16 @@ ) # step 2: assemble the data structure to be written - shortcutsDict = {} - # step 2.0: header - shortcutsDict["header"] = { - "comment": "eric keyboard shortcuts file", - "saved": time.strftime("%Y-%m-%d, %H:%M:%S"), - "author": Preferences.getUser("Email"), + shortcutsDict = { + # step 2.0: header + "header": { + "comment": "eric keyboard shortcuts file", + "saved": time.strftime("%Y-%m-%d, %H:%M:%S"), + "author": Preferences.getUser("Email"), + }, + # step 2.1: keyboard shortcuts + "shortcuts": actionsDict, } - # step 2.1: keyboard shortcuts - shortcutsDict["shortcuts"] = actionsDict try: jsonString = json.dumps(shortcutsDict, indent=2)