Skip to content

Commit 978455c

Browse files
committed
Refactor unlink method for Path objects for python <= 3.9 support
Resolves #47 Updated the unlink method for Path objects in `aicodebot/cli.py` and `tests/test_cli.py` for better readability and consistency. Now using `Path(temp_file_name).unlink()` instead of `Path.unlink(temp_file_name)`. 🔄📁
1 parent 90abba4 commit 978455c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

aicodebot/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def commit(verbose, response_token_size, yes, skip_pre_commit, files): # noqa:
182182
console.print(f"✅ {len(files)} file(s) committed.")
183183

184184
# Delete the temporary file
185-
Path.unlink(temp_file_name)
185+
Path(temp_file_name).unlink()
186186

187187

188188
@cli.command()

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_configure(cli_runner, tmp_path, monkeypatch):
7070
assert config_data["personality"] == DEFAULT_PERSONALITY.name
7171

7272
# remove the config file
73-
Path.unlink(temp_config_file)
73+
Path(temp_config_file).unlink()
7474
assert read_config() is None
7575

7676
# now unset the env var and run the command again with it passed as a flag

0 commit comments

Comments
 (0)