Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
14
tools/python/Util.py
Normal file
14
tools/python/Util.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
from contextlib import contextmanager
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
try:
|
||||
from tempfile import TemporaryDirectory
|
||||
except ImportError:
|
||||
@contextmanager
|
||||
def TemporaryDirectory():
|
||||
name = tempfile.mkdtemp()
|
||||
try:
|
||||
yield name
|
||||
finally:
|
||||
shutil.rmtree(name)
|
||||
Loading…
Add table
Add a link
Reference in a new issue