fix(notion-writer): use module-level sys instead of inline import in toggle warning

Code review caught a redundant `import sys as _sys` inside the unclosed-
<details> branch. The module already imports `sys` at the top, so the
inline import was dead weight. Use the module-level `sys.stderr` directly.

26/26 tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-27 11:23:49 +09:00
parent aac1082bb7
commit 0f8d7b2df1

View File

@@ -123,9 +123,8 @@ def _parse_lines(lines: List[str]) -> List[Dict[str, Any]]:
i += 1 i += 1
if depth > 0: if depth > 0:
# Unclosed <details> at EOF — degrade to paragraphs # Unclosed <details> at EOF — degrade to paragraphs
import sys as _sys
print("Warning: unclosed <details> at EOF; emitting body as paragraphs", print("Warning: unclosed <details> at EOF; emitting body as paragraphs",
file=_sys.stderr) file=sys.stderr)
if summary_text: if summary_text:
blocks.append(create_paragraph_block(summary_text)) blocks.append(create_paragraph_block(summary_text))
for inner in inner_lines: for inner in inner_lines: