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