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

aggr changes #2

Open
wants to merge 4 commits into
base: python3
Choose a base branch
from
Open

aggr changes #2

wants to merge 4 commits into from

Conversation

avi-slavkin
Copy link

No description provided.

@@ -1,4 +1,6 @@
from haigha2.connection import Connection
from six import PY2
Copy link

Choose a reason for hiding this comment

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

where is this used? I am not sure I understand what changed in this file

@@ -48,12 +50,11 @@ def __init__(self, *args, **kwargs):
# Transport API
###

def connect(self, address):
def connect(self, host_port_tuple):
Copy link

Choose a reason for hiding this comment

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

why we renamed the argument to host_port_tuple?
the connect interface useually pass address and lets the underline layer to handle the address format
https://docs.python.org/2/library/socket.html#socket.socket.connect

if six.PY2:
sslobj = self._context._wrap_socket(self._sock, server_side, ssl_sock=self, server_hostname=server_hostname)
else:
context = self.context if PY33 else self._context
Copy link

Choose a reason for hiding this comment

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

why we need to check PY33? what changed in python3.3? (add comment about it)

try:
# This is added in Python 3.5, http://bugs.python.org/issue21965
SSLObject = ssl.SSLObject
except NameError:
Copy link

Choose a reason for hiding this comment

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

do we expect NameError and not attribute error?

In [49]: import ssl

In [50]: ssl.SSLObject
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-50-f8284913d90b> in <module>()
----> 1 ssl.SSLObject

AttributeError: 'module' object has no attribute 'SSLObject'```

avi-slavkin and others added 3 commits May 27, 2019 13:55
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.

4 participants