fix(drift-check): handle SIGPIPE so | head does not traceback

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xefg5EXwcpd9RMAr63dWrD
This commit is contained in:
David F Glidden
2026-07-27 22:15:06 +02:00
co-authored by Claude
parent e8b6ce06a3
commit e8cd376741
+7 -1
View File
@@ -18,11 +18,17 @@ report, not a gate.
import json
import os
import re
import subprocess
import signal
import sys
from datetime import date
from pathlib import Path
# Report cleanly when the reader closes early (`| head`), rather than tracebacking.
try:
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
except (AttributeError, ValueError): # not POSIX, or not on the main thread
pass
HOME = Path.home()
CLAUDE_MD = HOME / "dotfiles" / "CLAUDE.md"
MONTHS = ("january february march april may june july august september "