Avoid AttributeError(_closed) when a TemporaryDirectory is deallocated whose mkdtemp call failed.
This commit is contained in:
parent
dd5909725c
commit
ab3734fd97
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue