From bd3e51f7bb5393d023c557bdcc130ccc05ed0058 Mon Sep 17 00:00:00 2001 From: Stuart Bishop Date: Sun, 18 Dec 2022 12:16:20 +1100 Subject: [PATCH] Rename all_timezones_unchecked to strongly indicate it is not public --- gen_tzinfo.py | 4 ++-- src/pytz/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gen_tzinfo.py b/gen_tzinfo.py index 0822bb2..c881bff 100644 --- a/gen_tzinfo.py +++ b/gen_tzinfo.py @@ -121,10 +121,10 @@ def add_allzones(filename): cz.append(zone) cz.sort() - print('all_timezones_unchecked = \\', file=outf) + print('_all_timezones_unchecked = \\', file=outf) pprint(sorted(allzones()), outf) print('''all_timezones = LazyList( - tz for tz in all_timezones_unchecked if resource_exists(tz)) + tz for tz in _all_timezones_unchecked if resource_exists(tz)) ''', file=outf) print('all_timezones_set = LazySet(all_timezones)', file=outf) # Per lp:1835784 we can't afford to do this at import time diff --git a/src/pytz/__init__.py b/src/pytz/__init__.py index cba72e9..59a3bc9 100644 --- a/src/pytz/__init__.py +++ b/src/pytz/__init__.py @@ -202,7 +202,7 @@ def _case_insensitive_zone_lookup(zone): """case-insensitively matching timezone, else return zone unchanged""" global _all_timezones_lower_to_standard if _all_timezones_lower_to_standard is None: - _all_timezones_lower_to_standard = dict((tz.lower(), tz) for tz in all_timezones_unchecked) # noqa + _all_timezones_lower_to_standard = dict((tz.lower(), tz) for tz in _all_timezones_unchecked) # noqa return _all_timezones_lower_to_standard.get(zone.lower()) or zone # noqa