summaryrefslogtreecommitdiff
path: root/lib/spack/llnl/util/lang.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/llnl/util/lang.py')
-rw-r--r--lib/spack/llnl/util/lang.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py
index b9b034d4d4..88058d4bd1 100644
--- a/lib/spack/llnl/util/lang.py
+++ b/lib/spack/llnl/util/lang.py
@@ -671,3 +671,12 @@ def uniq(sequence):
uniq_list.append(element)
last = element
return uniq_list
+
+
+class Devnull(object):
+ """Null stream with less overhead than ``os.devnull``.
+
+ See https://stackoverflow.com/a/2929954.
+ """
+ def write(self, *_):
+ pass