changeset 75:25d479e4ddb2

Merge pull request #16 from ps2/python3-stdin Use binary read for stdin on python3
author Amine SEHILI <amsehili@users.noreply.github.com>
date Sat, 15 Sep 2018 13:48:45 +0200
parents 60854b74ee5d (current diff) b37ca4131a04 (diff)
children 48c79343bc15
files
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/auditok/io.py	Sun Feb 05 12:06:04 2017 +0100
+++ b/auditok/io.py	Sat Sep 15 13:48:45 2018 +0200
@@ -417,7 +417,10 @@
             raise IOError("Stream is not open")
 
         to_read = size * self.sample_width * self.channels
-        data = sys.stdin.read(to_read)
+        if sys.version_info >= (3, 0):
+            data = sys.stdin.buffer.read(to_read)
+        else:
+            data = sys.stdin.read(to_read)
 
         if data is None or len(data) < 1:
             return None