fix: prevent stdout.close() in tests for OSError EPIPE handler
The OSError exception handler for EPIPE errors was calling sys.stdout.close() without checking the AUTO_CLAUDE_TESTS flag, causing CI to fail on test_safe_print_os_error_epipe. This adds the same _IN_TESTS check that the BrokenPipeError handler already has. Fixes CI failure: test-python on test-coverage-improvements branch
This commit is contained in:
@@ -72,7 +72,7 @@ def safe_print(message: str, flush: bool = True) -> None:
|
||||
if not _IN_TESTS:
|
||||
try:
|
||||
sys.stdout.close()
|
||||
except Exception: # stdout may already be closed
|
||||
except Exception:
|
||||
pass
|
||||
logger.debug("Output pipe closed (EPIPE)")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user