-
Notifications
You must be signed in to change notification settings - Fork 62
Return topic desctuctors #576
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -59,7 +59,11 @@ async def create_reader(): | |||||
|
|
||||||
| def __del__(self): | ||||||
| if not self._closed: | ||||||
| logger.warning("Topic reader was not closed properly. Consider using method close().") | ||||||
| try: | ||||||
| logger.warning("Topic reader was not closed properly. Consider using method close().") | ||||||
| self.close(flush=False) | ||||||
| except BaseException: | ||||||
|
||||||
| except BaseException: | |
| except Exception: |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -75,7 +75,11 @@ def __exit__(self, exc_type, exc_val, exc_tb): | |||||
|
|
||||||
| def __del__(self): | ||||||
| if not self._closed: | ||||||
| logger.warning("Topic writer was not closed properly. Consider using method close().") | ||||||
| try: | ||||||
| logger.warning("Topic writer was not closed properly. Consider using method close().") | ||||||
| self.close(flush=False) | ||||||
| except BaseException: | ||||||
|
||||||
| except BaseException: | |
| except Exception: |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -116,7 +116,11 @@ def __init__(self, driver: aio.Driver, settings: Optional[TopicClientSettings] = | |||||
|
|
||||||
| def __del__(self): | ||||||
| if not self._closed: | ||||||
| logger.warning("Topic client was not closed properly. Consider using method close().") | ||||||
| try: | ||||||
| logger.warning("Topic client was not closed properly. Consider using method close().") | ||||||
| self.close() | ||||||
| except BaseException: | ||||||
|
||||||
| except BaseException: | |
| except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching BaseException here might hide critical system exceptions; switching to Exception is recommended for more precise error handling.