Handle exception when deleting object, if pubsub topic was not subscribed properly
This commit is contained in:
parent
760a4b930b
commit
c655c112de
@ -33,6 +33,7 @@ import wx # type: ignore
|
|||||||
import logging
|
import logging
|
||||||
from typing import Optional, Any, cast
|
from typing import Optional, Any, cast
|
||||||
from pubsub import pub # type: ignore
|
from pubsub import pub # type: ignore
|
||||||
|
from pubsub.core.topicexc import TopicNameError
|
||||||
from platform_utils import paths # type: ignore
|
from platform_utils import paths # type: ignore
|
||||||
from . import core, utils
|
from . import core, utils
|
||||||
|
|
||||||
@ -166,4 +167,7 @@ class WXUpdater(core.UpdaterCore):
|
|||||||
|
|
||||||
def __del__(self) -> None:
|
def __del__(self) -> None:
|
||||||
""" Unsubscribe events before deleting this object. """
|
""" Unsubscribe events before deleting this object. """
|
||||||
pub.unsubscribe(self.on_update_progress, "updater.update-progress")
|
try:
|
||||||
|
pub.unsubscribe(self.on_update_progress, "updater.update-progress")
|
||||||
|
except TopicNameError:
|
||||||
|
pass
|
Loading…
Reference in New Issue
Block a user