Maksim Beliaev <[email protected]> added the comment:
just want to correct code that Nils post in the last comment to really take
args and kwargs
~~~
def mkdtemp_persistent(*args, persistent=True, **kwargs):
if persistent:
@contextmanager
def normal_mkdtemp():
yield tempfile.mkdtemp(*args, **kwargs)
return normal_mkdtemp()
else:
return tempfile.TemporaryDirectory(*args, **kwargs)
with mkdtemp_persistent(persistent=False) as dir:
...
~~~
----------
nosy: +beliaev-maksim
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue25024>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com