Skip to content

Commit 03bacbc

Browse files
committed
Move zone data into "tzdata.zoneinfo"
1 parent f7a623a commit 03bacbc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

update.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ def create_package(version: str, zoneinfo_dir: pathlib.Path):
9999
if target_dir.exists():
100100
shutil.rmtree(target_dir)
101101

102+
data_dir = target_dir / "zoneinfo"
103+
102104
# Next move the zoneinfo file to the target location
103-
shutil.move(os.fspath(zoneinfo_dir), target_dir)
105+
shutil.move(os.fspath(zoneinfo_dir), data_dir)
104106

105107
# Generate the base __init__.py from a template
106108
with open(TEMPLATES_DIR / "__init__.py.in", "r") as f_in:
@@ -111,7 +113,7 @@ def create_package(version: str, zoneinfo_dir: pathlib.Path):
111113
f_out.write(contents)
112114

113115
# Now recursively create __init__.py files in every directory we need to
114-
for dirpath, _, filenames in os.walk(target_dir):
116+
for dirpath, _, filenames in os.walk(data_dir):
115117
if "__init__.py" not in filenames:
116118
init_file = pathlib.Path(dirpath) / "__init__.py"
117119
init_file.touch()

0 commit comments

Comments
 (0)