summaryrefslogtreecommitdiff
path: root/support/lib
diff options
context:
space:
mode:
Diffstat (limited to 'support/lib')
-rw-r--r--support/lib/__init__.py0
-rw-r--r--support/lib/util.py18
2 files changed, 18 insertions, 0 deletions
diff --git a/support/lib/__init__.py b/support/lib/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/support/lib/__init__.py
diff --git a/support/lib/util.py b/support/lib/util.py
new file mode 100644
index 0000000..a3bc3dc
--- /dev/null
+++ b/support/lib/util.py
@@ -0,0 +1,18 @@
+import contextlib, subprocess, tempfile, shutil
+
+
+@contextlib.contextmanager
+def TemporaryDirectory():
+ dir = tempfile.mkdtemp()
+
+ try:
+ yield dir
+ finally:
+ shutil.rmtree(dir)
+
+
+def command(args):
+ process = subprocess.Popen(args)
+ process.wait()
+
+ assert not process.returncode