File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
addons/source-python/packages/source-python/commands Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 6
6
# =============================================================================
7
7
# >> IMPORTS
8
8
# =============================================================================
9
- # Python
9
+ # Python Imports
10
+ # Contextlib
11
+ from contextlib import suppress
10
12
# Inspect
11
13
import inspect
12
14
from inspect import Parameter
@@ -453,9 +455,10 @@ def __call__(self, callback):
453
455
return callback
454
456
455
457
def _unload_instance (self ):
456
- if self .parser .remove_command (self .commands ):
457
- self .manager .unregister_commands (
458
- self .command .command_to_register , self .on_command )
458
+ with suppress (ValueError ):
459
+ if self .parser .remove_command (self .commands ):
460
+ self .manager .unregister_commands (
461
+ self .command .command_to_register , self .on_command )
459
462
460
463
@classmethod
461
464
def on_command (cls , command , * args ):
You can’t perform that action at this time.
0 commit comments