From 7f3d166de0cfd998c06b229aa95fdc9bcf730b80 Mon Sep 17 00:00:00 2001 From: Archer Bowen Date: Fri, 28 Feb 2025 14:37:01 +0000 Subject: [PATCH] #2925 Replace try catch logic with a more elegant solution. --- src/primaite/game/agent/scripted_agents/TAP003.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/primaite/game/agent/scripted_agents/TAP003.py b/src/primaite/game/agent/scripted_agents/TAP003.py index b329f3e1..1dcebe07 100644 --- a/src/primaite/game/agent/scripted_agents/TAP003.py +++ b/src/primaite/game/agent/scripted_agents/TAP003.py @@ -384,11 +384,11 @@ class TAP003(AbstractTAP, discriminator="tap-003"): ], } self.logger.info(f"Changing password on remote node {hostname}") - try: - self._next_account_change = account_changes.pop(0) - except IndexError: + if len(account_changes) == 0: self.logger.info("No further account changes required.") self._next_account_change = None + else: + self._next_account_change = account_changes.pop(0) self._change_password_target_host = hostname if not self._next_account_change: self.logger.info("Manipulation complete. Progressing to exploit...")