Skip to content

Commit f448bf4

Browse files
committed
Remove vestigial _ensure_minimal_target shim
The shim was needed during the asn-as-targets / scope-rework work where Scanner.helpers fell back to self._unbaked_preset.helpers when self.preset was None. On this branch Scanner.__init__ synchronously bakes the preset, so by the time anyone reads .helpers the target already exists. Verified by sticking a raise inside _ensure_minimal_target and running step_1 + sample module tests + bbot --help/--list-modules — never fired.
1 parent f0d08e5 commit f448bf4

1 file changed

Lines changed: 0 additions & 23 deletions

File tree

bbot/scanner/preset/preset.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -588,34 +588,11 @@ def apply_log_level(self, apply_core=False):
588588
@property
589589
def helpers(self):
590590
if self._helpers is None:
591-
# Ensure we have at least a minimal target object before any helper (especially web helpers) is constructed.
592-
593-
self._ensure_minimal_target()
594591
from bbot.core.helpers.helper import ConfigAwareHelper
595592

596593
self._helpers = ConfigAwareHelper(preset=self)
597594
return self._helpers
598595

599-
def _ensure_minimal_target(self):
600-
"""
601-
Lazily construct a minimal BBOTTarget from the current seeds / whitelist / blacklist if one does not already exist.
602-
603-
This is intentionally lighter-weight than the full async target
604-
preparation performed in `bake()` (which also calls
605-
`target.generate_children()`).
606-
"""
607-
if self._target is not None:
608-
return
609-
610-
from bbot.scanner.target import BBOTTarget
611-
612-
self._target = BBOTTarget(
613-
*list(self._seeds),
614-
whitelist=self._whitelist, # modify this after scope rework branch is merged into dev
615-
blacklist=self._blacklist,
616-
strict_scope=self.strict_scope,
617-
)
618-
619596
@property
620597
def module_loader(self):
621598
self.environ

0 commit comments

Comments
 (0)