summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Belu <bclau@users.noreply.github.com>2017-03-02 17:29:52 +0100
committerFree Ekanayaka <free@ekanayaka.io>2017-03-02 17:29:52 +0100
commitf2721c1b4293ff0f6cd247888c24646b715db043 (patch)
treed4f5f39a4f5874411e5c6248c10ad81f89c2f08c
parent8263a3d95ccb74c257272662c40a440f78a314e8 (diff)
downloadsubunit-trunk.tar.gz
Fallback to reading one-byte-at-a-time on Windows (#22)HEADtrunk
select.select does not work on file descriptors on Windows, causing subunit to fail.
-rw-r--r--python/subunit/v2.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/subunit/v2.py b/python/subunit/v2.py
index 9ff139c..254617c 100644
--- a/python/subunit/v2.py
+++ b/python/subunit/v2.py
@@ -309,6 +309,11 @@ class ByteStreamToStreamResult(object):
# annoying).
buffered = [content]
while len(buffered[-1]):
+ # Note: Windows does not support passing a file descriptor to
+ # select.select. fallback to one-byte-at-a-time.
+ if sys.platform == 'win32':
+ break
+
try:
self.source.fileno()
except: