From 2f884743388c9be0071e022f5124590df48725a3 Mon Sep 17 00:00:00 2001 From: Paul Zabalegui Date: Wed, 10 Dec 2025 15:22:34 +0100 Subject: [PATCH] fix: Restore correct import of cai.caibench instead of pentestperf During rebase, the import was incorrectly changed from 'import cai.caibench as ptt' to 'import pentestperf as ptt'. This commit restores the correct import. The original code uses cai.caibench, not an external pentestperf module. --- src/cai/util.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cai/util.py b/src/cai/util.py index e693813d..b5acca68 100644 --- a/src/cai/util.py +++ b/src/cai/util.py @@ -31,8 +31,14 @@ from wasabi import color from cai import is_pentestperf_available +# Import caibench (pentestperf) if available if is_pentestperf_available(): - import pentestperf as ptt + import cai.caibench as ptt + PTT_AVAILABLE = True +else: + ptt = None + PTT_AVAILABLE = False + import signal # Global timing variables for tracking active and idle time @@ -4368,6 +4374,10 @@ def setup_ctf(): print(color("CTF name not provided, necessary to run CTF", fg="white", bg="red")) sys.exit(1) + if not PTT_AVAILABLE or ptt is None: + print(color("pentestperf module not available, cannot setup CTF", fg="white", bg="red")) + sys.exit(1) + print( color("Setting up CTF: ", fg="black", bg="yellow") + color(ctf_name, fg="black", bg="yellow")