summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/tempfile.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index cbaac43..7e03784 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -617,6 +617,8 @@ class TemporaryDirectory(object):
"""
def __init__(self, suffix="", prefix=template, dir=None):
+ # cleanup() needs this and is called even when mkdtemp fails
+ self._closed = True
self.name = mkdtemp(suffix, prefix, dir)
self._closed = False