mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
tempdirs in test_main now cleanup without windows errors
This commit is contained in:
parent
f4e4e3af87
commit
dd6a7964b6
2 changed files with 10 additions and 4 deletions
|
@ -17,11 +17,17 @@ class IgnorantTemporaryDirectory:
|
|||
return self.temp_dir.__enter__()
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
self.cleanup()
|
||||
|
||||
def cleanup(self):
|
||||
try:
|
||||
self.temp_dir.__exit__(exc_type, exc_val, exc_tb)
|
||||
self.temp_dir.cleanup()
|
||||
except (OSError, PermissionError):
|
||||
pass # Ignore errors (Windows)
|
||||
|
||||
def __getattr__(self, item):
|
||||
return getattr(self.temp_dir, item)
|
||||
|
||||
|
||||
class ChdirTemporaryDirectory(IgnorantTemporaryDirectory):
|
||||
def __init__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue