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 fake_connection abortConnection under Twisted 16.1 #1033

Merged
merged 3 commits into from
Apr 8, 2016

Conversation

hodgestar
Copy link
Contributor

Twisted 16.1 adds its own abortConnection, so we need to improve our wrapping of abortConnection for fake connections.

@@ -220,10 +220,16 @@ def patch_transport_abortConnection(transport, protocol):
Patch abortConnection() onto the transport if it doesn't already have it.
(`Agent` assumes its transport has this.)
"""
_old_abortConnection = getattr(transport, 'abortConnection', None)
Copy link
Member

Choose a reason for hiding this comment

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

getattr(transport, 'abortConnection', transport.loseConnection) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice! Added.

@@ -220,10 +220,14 @@ def patch_transport_abortConnection(transport, protocol):
Patch abortConnection() onto the transport if it doesn't already have it.
(`Agent` assumes its transport has this.)
"""
Copy link
Member

Choose a reason for hiding this comment

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

The docstring should probably explain that even if the method is there, we may need to track that it's an abort so we can swap out the connectionLost reason.

@jerith
Copy link
Member

jerith commented Apr 8, 2016

👍 after the docstring update.

@hodgestar
Copy link
Contributor Author

hodgestar commented Apr 8, 2016 via email

@hodgestar hodgestar merged commit 605a897 into develop Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants