timezone: Improve tzdata parser’s compatibility with zic(8).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-09-20 15:46:58 -07:00 committed by Tim Abbott
parent 7222f3fe2b
commit 2e9cd20380
1 changed files with 3 additions and 2 deletions

View File

@ -9,8 +9,9 @@ def get_canonical_timezone_map() -> Dict[str, str]:
canonical = {}
with get_tzdata_zi() as f:
for line in f:
if line.startswith("L "):
l, name, alias = line.split()
fields = line.split()
if fields and "link".startswith(fields[0].lower()): # zic(8) accepts any prefix of Link
code, name, alias = fields
canonical[alias] = name
return canonical