aboutsummaryrefslogtreecommitdiffstats
path: root/waflib/extras
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:14:03 +0100
commitea9e3614ce1bc4fcb8e6fdb05f7b071d6d043c6d (patch)
tree64ca9050005d86cfe0889dd2ebcf91e30c10bcd8 /waflib/extras
parent1fb8ac0d29e670eaaffd7864ceab62b9f4650ff8 (diff)
downloadserd-ea9e3614ce1bc4fcb8e6fdb05f7b071d6d043c6d.tar.gz
serd-ea9e3614ce1bc4fcb8e6fdb05f7b071d6d043c6d.tar.bz2
serd-ea9e3614ce1bc4fcb8e6fdb05f7b071d6d043c6d.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.
Diffstat (limited to 'waflib/extras')
-rw-r--r--waflib/extras/autowaf.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/waflib/extras/autowaf.py b/waflib/extras/autowaf.py
index 51077d18..c28cc1aa 100644
--- a/waflib/extras/autowaf.py
+++ b/waflib/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,