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:
co-authored by
Claude
parent
e8b6ce06a3
commit
e8cd376741
@@ -18,11 +18,17 @@ report, not a gate.
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import signal
|
||||||
import sys
|
import sys
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from pathlib import Path
|
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()
|
HOME = Path.home()
|
||||||
CLAUDE_MD = HOME / "dotfiles" / "CLAUDE.md"
|
CLAUDE_MD = HOME / "dotfiles" / "CLAUDE.md"
|
||||||
MONTHS = ("january february march april may june july august september "
|
MONTHS = ("january february march april may june july august september "
|
||||||
|
|||||||
Reference in New Issue
Block a user