Skip to content

Commit

Permalink
Use ... if expr else ...
Browse files Browse the repository at this point in the history
  • Loading branch information
jun66j5 committed May 10, 2022
1 parent db534f3 commit cf1abf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion babel/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ def format_period(self, char, num):
widths = [{3: 'abbreviated', 4: 'wide', 5: 'narrow'}[max(3, num)],
'wide', 'narrow', 'abbreviated']
if char == 'a':
period = {0: 'am', 1: 'pm'}[int(self.value.hour >= 12)]
period = 'pm' if self.value.hour >= 12 else 'am'
context = 'format'
else:
period = get_period_id(self.value, locale=self.locale)
Expand Down

0 comments on commit cf1abf1

Please sign in to comment.