Skip to content

Commit 28aed78

Browse files
bug: lib/bot_debugger: call bots with standalone flag
to raise systemexit exceptions at the bot's processing end
1 parent 1442e6b commit 28aed78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

intelmq/lib/bot_debugger.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def __init__(self, runtime_configuration, bot_id, run_subcommand=None, console_t
6565
# Set's the bot's default and initial value for the logging_level to the value we want
6666
bot.logging_level = self.logging_level
6767

68-
self.instance = bot(bot_id, disable_multithreading=True)
68+
self.instance = bot(bot_id, disable_multithreading=True,
69+
standalone=True, # instruct the bot to call SystemExit exception at the end or in case of errors
70+
)
6971

7072
def run(self) -> str:
7173
if not self.run_subcommand:
@@ -221,4 +223,5 @@ def pprint(msg) -> str:
221223
def __del__(self):
222224
# prevents a SystemExit Exception at object deletion
223225
# remove once PR#2358 (library mode) is merged
224-
setattr(self.instance, 'testing', True)
226+
if self.instance:
227+
setattr(self.instance, 'testing', True)

0 commit comments

Comments
 (0)