diff options
author | kjwon15 <[email protected]> | 2017-11-25 03:09:38 +0900 |
---|---|---|
committer | kjwon15 <[email protected]> | 2017-11-25 03:09:38 +0900 |
commit | 3faf7c6473ab22dd98b53fcecfd0b7e772aa8699 (patch) | |
tree | db790c137488d8733c7565bb898572d697dc361d /mastodon | |
parent | fa1840c0fb91a3ac8ff48b37bbe78f63623397ec (diff) | |
download | mastodon.py-3faf7c6473ab22dd98b53fcecfd0b7e772aa8699.tar.gz |
Get current thread correctly
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/Mastodon.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 1802cd1..3eb2cd7 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py | |||
@@ -1305,7 +1305,6 @@ class Mastodon: | |||
1305 | class __stream_handle(): | 1305 | class __stream_handle(): |
1306 | def __init__(self, connection): | 1306 | def __init__(self, connection): |
1307 | self.connection = connection | 1307 | self.connection = connection |
1308 | self._thread = threading.current_thread() | ||
1309 | 1308 | ||
1310 | def close(self): | 1309 | def close(self): |
1311 | self.connection.close() | 1310 | self.connection.close() |
@@ -1314,6 +1313,7 @@ class Mastodon: | |||
1314 | return self._thread.is_alive() | 1313 | return self._thread.is_alive() |
1315 | 1314 | ||
1316 | def _threadproc(self): | 1315 | def _threadproc(self): |
1316 | self._thread = threading.current_thread() | ||
1317 | with closing(connection) as r: | 1317 | with closing(connection) as r: |
1318 | try: | 1318 | try: |
1319 | listener.handle_stream(r.iter_lines()) | 1319 | listener.handle_stream(r.iter_lines()) |