mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
feat: add Python version check for TemporaryDirectory
This commit is contained in:
parent
4db6e28118
commit
0ec7f8c0c4
1 changed files with 4 additions and 1 deletions
|
@ -15,7 +15,10 @@ IMAGE_EXTENSIONS = {".png", ".jpg", ".jpeg", ".gif", ".bmp", ".tiff", ".webp"}
|
||||||
|
|
||||||
class IgnorantTemporaryDirectory:
|
class IgnorantTemporaryDirectory:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.temp_dir = tempfile.TemporaryDirectory(ignore_cleanup_errors=True)
|
if sys.version_info >= (3, 10):
|
||||||
|
self.temp_dir = tempfile.TemporaryDirectory(ignore_cleanup_errors=True)
|
||||||
|
else:
|
||||||
|
self.temp_dir = tempfile.TemporaryDirectory()
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
return self.temp_dir.__enter__()
|
return self.temp_dir.__enter__()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue