Skip to content

Commit

Permalink
fix(cli/migrate): avoid reliance on Python 3.12 argument
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie committed Jun 26, 2024
1 parent 254937a commit be7a06b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/openai/cli/_tools/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ def install() -> Path:
unpacked_dir.mkdir(parents=True, exist_ok=True)

with tarfile.open(temp_file, "r:gz") as archive:
archive.extractall(unpacked_dir, filter="data")
if sys.version_info >= (3, 12):
archive.extractall(unpacked_dir, filter="data")
else:
archive.extractall(unpacked_dir)

for item in unpacked_dir.iterdir():
item.rename(target_dir / item.name)
Expand Down

0 comments on commit be7a06b

Please sign in to comment.