aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkjwon15 <[email protected]>2017-11-25 03:09:38 +0900
committerkjwon15 <[email protected]>2017-11-25 03:09:38 +0900
commit3faf7c6473ab22dd98b53fcecfd0b7e772aa8699 (patch)
treedb790c137488d8733c7565bb898572d697dc361d /mastodon/Mastodon.py
parentfa1840c0fb91a3ac8ff48b37bbe78f63623397ec (diff)
downloadmastodon.py-3faf7c6473ab22dd98b53fcecfd0b7e772aa8699.tar.gz
Get current thread correctly
Diffstat (limited to 'mastodon/Mastodon.py')
-rw-r--r--mastodon/Mastodon.py2
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())
Powered by cgit v1.2.3 (git 2.41.0)