changeset 19:49ff2772891d

handle bytes case
author Jeff Hammel <k0scist@gmail.com>
date Fri, 13 Aug 2021 10:52:57 -0700
parents 6718f2808a65
children baa70e3b3896
files wordstream/api.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/wordstream/api.py	Tue Nov 24 10:48:04 2020 -0800
+++ b/wordstream/api.py	Fri Aug 13 10:52:57 2021 -0700
@@ -17,6 +17,8 @@
                 del self[word]
 
     def feed_stream(self, stream):
+        if isinstance(stream, bytes):
+            stream = stream.decode('utf-8')
         if isinstance(stream, str):
             stream = stream.split()
         while len(stream) > 1: