Skip to content

Commit 6fd5cc2

Browse files
committed
Replace os.replace with Path.replace for file moves and remove unused os import
1 parent 3d0d1be commit 6fd5cc2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ddbj_search_converter/dblink/db.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
- 最終 DB: {const_dir}/dblink/dblink.duckdb
1111
"""
1212

13-
import os
1413
from collections.abc import Iterable, Iterator
1514
from pathlib import Path
1615
from typing import Literal
@@ -99,7 +98,7 @@ def finalize_relation_db(config: Config) -> None:
9998
tmp_path = _tmp_db_path(config)
10099
final_path = _final_db_path(config)
101100

102-
os.replace(tmp_path, final_path)
101+
tmp_path.replace(final_path)
103102

104103

105104
# === Write operations ===
@@ -383,7 +382,7 @@ def finalize_umbrella_db(config: Config) -> None:
383382
""")
384383

385384
final_path = _umbrella_final_db_path(config)
386-
os.replace(tmp_path, final_path)
385+
tmp_path.replace(final_path)
387386

388387

389388
def save_umbrella_relations(config: Config, relations: IdPairs) -> None:

0 commit comments

Comments
 (0)