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

Cleanup dead resetFrame code #2082

Merged
merged 3 commits into from
Mar 5, 2024
Merged

Cleanup dead resetFrame code #2082

merged 3 commits into from
Mar 5, 2024

Conversation

alexrudd2
Copy link
Collaborator

@alexrudd2 alexrudd2 commented Mar 5, 2024

mypy flags the else branch as unreachable because the isinstance check always passes. I think this happened in ce67df9 but went unnoticed because the function isn't annotated.

if isinstance(self, ModbusServerRequestHandler):
Log.error(
'Unknown exception "{}" on stream {} forcing disconnect',
exc,
self.comm_params.comm_name,
)
self.close()
self.callback_disconnected(exc)
else:
Log.error("Unknown error occurred {}", exc)
reset_frame = True # graceful recovery

So this PR deletes the entire conditional, as well as the now-useless reset_frame flag.

Also, it cleans up the docstring mangled by 18aa463

Copy link
Collaborator

@janiversen janiversen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@janiversen janiversen merged commit f1c18d2 into dev Mar 5, 2024
1 check passed
@janiversen janiversen deleted the reset-frame branch March 5, 2024 17:43
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants