diff options
author | Lorenz Diener <[email protected]> | 2017-12-19 13:49:00 +0100 |
---|---|---|
committer | Lorenz Diener <[email protected]> | 2017-12-19 13:49:00 +0100 |
commit | 9f9a7826d7bdb30eb394c6fd9f4fdafb06e9bfae (patch) | |
tree | cf7fe9a4e2467a4a6c7f9d9fce7a34798ad0512e /mastodon/Mastodon.py | |
parent | e5c50ea80d86449b5f95a32cf3a01d7bf8e9d2f4 (diff) | |
download | mastodon.py-9f9a7826d7bdb30eb394c6fd9f4fdafb06e9bfae.tar.gz |
Fix streaming API to be more stable (closes #117)
Diffstat (limited to 'mastodon/Mastodon.py')
-rw-r--r-- | mastodon/Mastodon.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index a2f7738..ca4849f 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1684,7 +1684,7 @@ class Mastodon: | |||
1684 | self._thread = threading.current_thread() | 1684 | self._thread = threading.current_thread() |
1685 | with closing(connection) as r: | 1685 | with closing(connection) as r: |
1686 | try: | 1686 | try: |
1687 | listener.handle_stream(r.iter_lines(chunk_size = 1, decode_unicode = True)) | 1687 | listener.handle_stream(r) |
1688 | except AttributeError as e: | 1688 | except AttributeError as e: |
1689 | if not self.closed: | 1689 | if not self.closed: |
1690 | raise e | 1690 | raise e |
@@ -1699,7 +1699,7 @@ class Mastodon: | |||
1699 | else: | 1699 | else: |
1700 | # Blocking, never returns (can only leave via exception) | 1700 | # Blocking, never returns (can only leave via exception) |
1701 | with closing(connection) as r: | 1701 | with closing(connection) as r: |
1702 | listener.handle_stream(r.iter_lines()) | 1702 | listener.handle_stream(r) |
1703 | 1703 | ||
1704 | def __generate_params(self, params, exclude=[]): | 1704 | def __generate_params(self, params, exclude=[]): |
1705 | """ | 1705 | """ |