Fix a rare crash when a failed node is garbage collected

This commit is contained in:
Julien Duponchelle 2016-11-03 14:21:28 +01:00
parent 1e73962e33
commit 0d6adb0620
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -102,7 +102,7 @@ class BaseNode:
def __del__(self):
if self._temporary_directory is not None:
if hasattr(self, "_temporary_directory") and self._temporary_directory is not None:
if os.path.exists(self._temporary_directory):
shutil.rmtree(self._temporary_directory, ignore_errors=True)