Skip to content

Commit cc507eb

Browse files
refactor: add explicit else branch in with_warn_for_invalid_lines
Makes the strict/non-strict code paths explicitly mutually exclusive for better readability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e23f928 commit cc507eb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/dotenv/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ def with_warn_for_invalid_lines(
4040
"python-dotenv could not parse statement starting at line %s"
4141
% mapping.original.line,
4242
)
43-
logger.warning(
44-
"python-dotenv could not parse statement starting at line %s",
45-
mapping.original.line,
46-
)
43+
else:
44+
logger.warning(
45+
"python-dotenv could not parse statement starting at line %s",
46+
mapping.original.line,
47+
)
4748
yield mapping
4849

4950

0 commit comments

Comments
 (0)