Skip to content

Commit

Permalink
Ignore falsy values in default_locale args
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Jan 29, 2025
1 parent 4f55506 commit 2bd0865
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions babel/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,8 @@ def default_locale(
raise TypeError(f"Invalid type for category: {category!r}")

for name in varnames:
if not name:
continue

Check warning on line 1134 in babel/core.py

View check run for this annotation

Codecov / codecov/patch

babel/core.py#L1134

Added line #L1134 was not covered by tests
locale = os.getenv(name)
if locale:
if name == 'LANGUAGE' and ':' in locale:
Expand Down

0 comments on commit 2bd0865

Please # to comment.