@@ -1027,7 +1027,7 @@ def from_dict(self, options: dict[str, str | dict[str, bool | int | float | str]
10271027 self ._options = options
10281028 self ._set_options ()
10291029
1030- def to_dict (self ) -> dict [str , str | dict [str , bool | int | float | str ]] | None :
1030+ def to_dict (self ) -> dict [str , str | dict [str , bool | int | float | str ] | None ] | None :
10311031 """Collect the current GUI options and place them in a dict for retrieval or storage.
10321032
10331033 This function is required for reloading the GUI state when the GUI has been force
@@ -1037,15 +1037,14 @@ def to_dict(self) -> dict[str, str | dict[str, bool | int | float | str]] | None
10371037 -------
10381038 The current cli options ready for saving or retrieval by :func:`from_dict`
10391039 """
1040- opts = T .cast (dict [str , str | dict [str , bool | int | float | str ]],
1040+ opts = T .cast (dict [str , str | dict [str , bool | int | float | str ] | None ],
10411041 self ._current_gui_state ())
10421042 logger .debug ("Collected opts: %s" , opts )
10431043 if not opts or opts == self ._default_options :
10441044 logger .debug ("Default session, or no opts found. Not saving last session." )
10451045 return None
10461046 opts ["tab_name" ] = self ._active_tab
10471047 fname = self ._config .project .filename
1048- assert fname is not None
10491048 opts ["project" ] = fname
10501049 logger .debug ("Added project items: %s" , {k : v for k , v in opts .items ()
10511050 if k in ("tab_name" , "project" )})
0 commit comments