MCPcopy Create free account
hub / github.com/FastLED/FastLED / CrashPatternInterceptor

Class CrashPatternInterceptor

ci/autoresearch/runner.py:46–71  ·  view source on GitHub ↗

Wraps sys.stdout to detect crash patterns in ALL output. Any line matching a crash pattern is recorded. The caller checks ``crash_detected`` after the run completes.

Source from the content-addressed store, hash-verified

44
45
46class CrashPatternInterceptor:
47 """Wraps sys.stdout to detect crash patterns in ALL output.
48
49 Any line matching a crash pattern is recorded. The caller checks
50 ``crash_detected`` after the run completes.
51 """
52
53 def __init__(self, inner: Any) -> None:
54 self._inner = inner
55 self.crash_detected: bool = False
56 self.crash_lines: list[str] = []
57
58 def write(self, s: str) -> int:
59 for line in s.splitlines():
60 for pattern in _STDOUT_CRASH_PATTERNS:
61 if pattern.search(line):
62 self.crash_detected = True
63 self.crash_lines.append(line.strip())
64 break
65 return self._inner.write(s)
66
67 def flush(self) -> None:
68 self._inner.flush()
69
70 def __getattr__(self, name: str) -> Any:
71 return getattr(self._inner, name)
72
73
74# ============================================================

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected