diff --git a/addons/source-python/packages/source-python/commands/typed.py b/addons/source-python/packages/source-python/commands/typed.py index 0726fbe28..ae7f290e6 100644 --- a/addons/source-python/packages/source-python/commands/typed.py +++ b/addons/source-python/packages/source-python/commands/typed.py @@ -6,7 +6,9 @@ # ============================================================================= # >> IMPORTS # ============================================================================= -# Python +# Python Imports +# Contextlib +from contextlib import suppress # Inspect import inspect from inspect import Parameter @@ -453,9 +455,10 @@ def __call__(self, callback): return callback def _unload_instance(self): - if self.parser.remove_command(self.commands): - self.manager.unregister_commands( - self.command.command_to_register, self.on_command) + with suppress(ValueError): + if self.parser.remove_command(self.commands): + self.manager.unregister_commands( + self.command.command_to_register, self.on_command) @classmethod def on_command(cls, command, *args):