summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-18 12:22:52 +0100
committerDavid Robillard <d@drobilla.net>2019-03-18 13:19:04 +0100
commit6e4e92b0bd871033af80d2ba5c0480807f7d6ca2 (patch)
tree2b36ff5d78013b1ea7ecfb0e84bb073e133c9b60
parente7a29b6b9b2f842314244c23c14d8f8f560904e1 (diff)
downloadautowaf-6e4e92b0bd871033af80d2ba5c0480807f7d6ca2.tar.gz
autowaf-6e4e92b0bd871033af80d2ba5c0480807f7d6ca2.tar.bz2
autowaf-6e4e92b0bd871033af80d2ba5c0480807f7d6ca2.zip
Seek to end before checking the size of stderr output
This fixes the error message checks in virtual environments where temporary files act weird.
-rw-r--r--extras/autowaf.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/extras/autowaf.py b/extras/autowaf.py
index 51077d1..c28cc1a 100644
--- a/extras/autowaf.py
+++ b/extras/autowaf.py
@@ -888,9 +888,10 @@ class TestScope:
if 'stderr' in kwargs and kwargs['stderr'] == NONEMPTY:
# Run with a temp file for stderr and check that it is non-empty
import tempfile
- with tempfile.TemporaryFile(mode='w') as stderr:
+ with tempfile.TemporaryFile() as stderr:
kwargs['stderr'] = stderr
output = self.run(test, **kwargs)
+ stderr.seek(0, 2) # Seek to end
return (output if not output else
self.run(
lambda: stderr.tell() > 0,