Get current thread correctly
This commit is contained in:
pare
fa1840c0fb
commit
3faf7c6473
S'han modificat 1 arxius amb 1 adicions i 1 eliminacions
|
@ -1305,7 +1305,6 @@ class Mastodon:
|
||||||
class __stream_handle():
|
class __stream_handle():
|
||||||
def __init__(self, connection):
|
def __init__(self, connection):
|
||||||
self.connection = connection
|
self.connection = connection
|
||||||
self._thread = threading.current_thread()
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.connection.close()
|
self.connection.close()
|
||||||
|
@ -1314,6 +1313,7 @@ class Mastodon:
|
||||||
return self._thread.is_alive()
|
return self._thread.is_alive()
|
||||||
|
|
||||||
def _threadproc(self):
|
def _threadproc(self):
|
||||||
|
self._thread = threading.current_thread()
|
||||||
with closing(connection) as r:
|
with closing(connection) as r:
|
||||||
try:
|
try:
|
||||||
listener.handle_stream(r.iter_lines())
|
listener.handle_stream(r.iter_lines())
|
||||||
|
|
Loading…
Referencia en una nova incidència