Skip to content

Commit 4181701

Browse files
committed
Fix backward compatibility
1 parent fa8f6be commit 4181701

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

intelmq/lib/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ def _get_console_entry_points():
855855
def get_bot_module_name(bot_name: str) -> str:
856856
entries = entry_points()
857857
if hasattr(entries, "select"):
858-
entries = entries.select(name=bot_name, group="console_scripts")
858+
entries = tuple(entries.select(name=bot_name, group="console_scripts"))
859859
else:
860860
entries = [entry for entry in entries.get("console_scripts", []) if entry.name == bot_name]
861861

intelmq/tests/lib/test_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ def test_get_bot_module_name_builtin_bot(self):
350350
found_name = utils.get_bot_module_name("intelmq.bots.collectors.api.collector_api")
351351
self.assertEqual("intelmq.bots.collectors.api.collector_api", found_name)
352352

353+
self.assertIsNone(utils.get_bot_module_name("intelmq.not-existing-bot"))
354+
353355
def test_get_bots_settings(self):
354356
with unittest.mock.patch.object(utils, "get_runtime", new_get_runtime):
355357
runtime = utils.get_bots_settings()

0 commit comments

Comments
 (0)