summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Omae <jun66j5@gmail.com>2022-05-10 17:01:45 +0900
committerJun Omae <jun66j5@gmail.com>2022-05-10 17:01:45 +0900
commitcf1abf100a977e0619e3f64f83905e3dd8676fe1 (patch)
tree67eedd453e3b05fdbea10bfd2aae0f396cbe1cd0
parentdb534f313315a651b61085fc94ba2e13076e02da (diff)
downloadbabel-cf1abf100a977e0619e3f64f83905e3dd8676fe1.tar.gz
Use `... if expr else ...`
-rw-r--r--babel/dates.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/babel/dates.py b/babel/dates.py
index c79e9cf..0b37323 100644
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -1483,7 +1483,7 @@ class DateTimeFormat(object):
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)