Skip to content

Commit

Permalink
Rename all_timezones_unchecked to strongly indicate it is not public
Browse files Browse the repository at this point in the history
  • Loading branch information
stub42 committed Dec 18, 2022
1 parent 01592a9 commit bd3e51f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gen_tzinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pytz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit bd3e51f

Please sign in to comment.