mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46124: Update zoneinfo to rely on importlib.resources traversable API. (GH-30190)
Automerge-Triggered-By: GH:jaraco
This commit is contained in:
parent
f1e559b754
commit
00b2b578bd
3 changed files with 4 additions and 3 deletions
|
@ -118,7 +118,7 @@ def available_timezones():
|
|||
# Start with loading from the tzdata package if it exists: this has a
|
||||
# pre-assembled list of zones that only requires opening one file.
|
||||
try:
|
||||
with resources.open_text("tzdata", "zones") as f:
|
||||
with resources.files("tzdata").joinpath("zones").open("r") as f:
|
||||
for zone in f:
|
||||
zone = zone.strip()
|
||||
if zone:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue