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 SyntaxError with using 'async' as parameter name #125

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions tlslite/tlsconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, sock):

def handshakeClientAnonymous(self, session=None, settings=None,
checker=None, serverName="",
async=False):
_async=False):
"""Perform an anonymous handshake in the role of client.

This function performs an SSL or TLS handshake using an
Expand Down Expand Up @@ -102,16 +102,16 @@ def handshakeClientAnonymous(self, session=None, settings=None,
@type serverName: string
@param serverName: The ServerNameIndication TLS Extension.

@type async: bool
@param async: If False, this function will block until the
@type _async: bool
@param _async: If False, this function will block until the
handshake is completed. If True, this function will return a
generator. Successive invocations of the generator will
return 0 if it is waiting to read from the socket, 1 if it is
waiting to write to the socket, or will raise StopIteration if
the handshake operation is completed.

@rtype: None or an iterable
@return: If 'async' is True, a generator object will be
@return: If '_async' is True, a generator object will be
returned.

@raise socket.error: If a socket error occurs.
Expand All @@ -126,15 +126,15 @@ def handshakeClientAnonymous(self, session=None, settings=None,
settings=settings,
checker=checker,
serverName=serverName)
if async:
if _async:
return handshaker
for result in handshaker:
pass

def handshakeClientSRP(self, username, password, session=None,
settings=None, checker=None,
reqTack=True, serverName="",
async=False):
_async=False):
"""Perform an SRP handshake in the role of client.

This function performs a TLS/SRP handshake. SRP mutually
Expand Down Expand Up @@ -179,16 +179,16 @@ def handshakeClientSRP(self, username, password, session=None,
@type serverName: string
@param serverName: The ServerNameIndication TLS Extension.

@type async: bool
@param async: If False, this function will block until the
@type _async: bool
@param _async: If False, this function will block until the
handshake is completed. If True, this function will return a
generator. Successive invocations of the generator will
return 0 if it is waiting to read from the socket, 1 if it is
waiting to write to the socket, or will raise StopIteration if
the handshake operation is completed.

@rtype: None or an iterable
@return: If 'async' is True, a generator object will be
@return: If '_async' is True, a generator object will be
returned.

@raise socket.error: If a socket error occurs.
Expand All @@ -206,17 +206,17 @@ def handshakeClientSRP(self, username, password, session=None,
# fashion, returning 1 when it is waiting to able to write, 0 when
# it is waiting to read.
#
# If 'async' is True, the generator is returned to the caller,
# If '_async' is True, the generator is returned to the caller,
# otherwise it is executed to completion here.
if async:
if _async:
return handshaker
for result in handshaker:
pass

def handshakeClientCert(self, certChain=None, privateKey=None,
session=None, settings=None, checker=None,
nextProtos=None, reqTack=True, serverName="",
async=False):
_async=False):
"""Perform a certificate-based handshake in the role of client.

This function performs an SSL or TLS handshake. The server
Expand Down Expand Up @@ -273,16 +273,16 @@ def handshakeClientCert(self, certChain=None, privateKey=None,
@type serverName: string
@param serverName: The ServerNameIndication TLS Extension.

@type async: bool
@param async: If False, this function will block until the
@type _async: bool
@param _async: If False, this function will block until the
handshake is completed. If True, this function will return a
generator. Successive invocations of the generator will
return 0 if it is waiting to read from the socket, 1 if it is
waiting to write to the socket, or will raise StopIteration if
the handshake operation is completed.

@rtype: None or an iterable
@return: If 'async' is True, a generator object will be
@return: If '_async' is True, a generator object will be
returned.

@raise socket.error: If a socket error occurs.
Expand All @@ -301,9 +301,9 @@ def handshakeClientCert(self, certChain=None, privateKey=None,
# fashion, returning 1 when it is waiting to able to write, 0 when
# it is waiting to read.
#
# If 'async' is True, the generator is returned to the caller,
# If '_async' is True, the generator is returned to the caller,
# otherwise it is executed to completion here.
if async:
if _async:
return handshaker
for result in handshaker:
pass
Expand Down