Skip to content

Commit 2f4059c

Browse files
trillllianakx
andauthored
Apply review suggestion
Co-authored-by: Aarni Koskela <akx@iki.fi>
1 parent f4000c1 commit 2f4059c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

babel/units.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ def format_unit(
156156
# so these aliases specified in `root.xml` are hard-coded here:
157157
# <unitLength type="long"><alias source="locale" path="../unitLength[@type='short']"/></unitLength>
158158
# <unitLength type="narrow"><alias source="locale" path="../unitLength[@type='short']"/></unitLength>
159-
lengths_to_check = [length]
160-
if length in ("long", "narrow"):
161-
lengths_to_check.append("short")
159+
lengths_to_check = [length, "short"] if length in ("long", "narrow") else [length]
162160

163161
for real_length in lengths_to_check:
164162
length_patterns = unit_patterns.get(real_length, {})

0 commit comments

Comments
 (0)