diff options
author | Jun Omae <jun66j5@gmail.com> | 2022-05-10 17:01:45 +0900 |
---|---|---|
committer | Jun Omae <jun66j5@gmail.com> | 2022-05-10 17:01:45 +0900 |
commit | cf1abf100a977e0619e3f64f83905e3dd8676fe1 (patch) | |
tree | 67eedd453e3b05fdbea10bfd2aae0f396cbe1cd0 | |
parent | db534f313315a651b61085fc94ba2e13076e02da (diff) | |
download | babel-cf1abf100a977e0619e3f64f83905e3dd8676fe1.tar.gz |
Use `... if expr else ...`
-rw-r--r-- | babel/dates.py | 2 |
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) |