diff options
author | W. Trevor King <wking@drexel.edu> | 2008-11-23 07:19:36 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-11-23 07:19:36 -0500 |
commit | 1edae6ccd13951120b8347e97130de57a3d6f60e (patch) | |
tree | d573ae6045eafed9dc6fef52d18f1603550a698c /libbe | |
parent | 9e0a846ff4fdaac45665e5a1e085aa37e3fa135b (diff) | |
download | bugseverywhere-1edae6ccd13951120b8347e97130de57a3d6f60e.tar.gz |
Fixed "'NoneType' object is not callable" error in libbe/utility/Dir.__del__
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/utility.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libbe/utility.py b/libbe/utility.py index 3f69a95..7c1d10a 100644 --- a/libbe/utility.py +++ b/libbe/utility.py @@ -101,11 +101,14 @@ class Dir (object): "A temporary directory for testing use" def __init__(self): self.path = tempfile.mkdtemp(prefix="BEtest") - self.shutil = shutil # save local reference for __del__ + self.rmtree = shutil.rmtree # save local reference for __del__ + self.removed = False def __del__(self): self.cleanup() def cleanup(self): - self.shutil.rmtree(self.path) + if self.removed == False: + self.rmtree(self.path) + self.removed = True def __call__(self): return self.path |