Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix threading related deprecations in Python 3.10. #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dxlclient/_request_manager.py
Expand Up @@ -229,7 +229,7 @@ def on_response(self, response):
if request_message_id in self.sync_wait_message_ids:
self.sync_wait_message_ids.remove(request_message_id)
self.sync_wait_message_responses[request_message_id] = response
self.sync_wait_message_condition.notifyAll()
self.sync_wait_message_condition.notify_all()

# Check for asynchronous callbacks
callback = self.unregister_async_callback(request_message_id)
Expand Down
4 changes: 2 additions & 2 deletions dxlclient/client.py
Expand Up @@ -605,7 +605,7 @@ def _disconnect(self):
logger.debug("Waiting for the thread to terminate...")
self._thread_terminate = True
with self._connect_wait_lock:
self._connect_wait_condition.notifyAll()
self._connect_wait_condition.notify_all()
while self._thread.is_alive():
self._thread.join(1)
self._thread = None
Expand Down Expand Up @@ -944,7 +944,7 @@ def sync_request(self, request, timeout=_DEFAULT_WAIT):
to the request. If the timeout is exceeded an exception will be raised. Defaults to ``3600``
seconds (1 hour)
"""
if threading.currentThread().name.startswith(self._message_pool_prefix):
if threading.current_thread().name.startswith(self._message_pool_prefix):
raise DxlException("Synchronous requests may not be invoked while handling an incoming message. " +
"The synchronous request must be made on a different thread.")

Expand Down