Add cpython specific constants to ssl (#291)

* Revert "Revert "add types to ssl for py2 (#251)""

This reverts commit 0b19fb471c (thus re-adding types to ssl).

* add some undocumented ssl constants
This commit is contained in:
Valérian Rousset
2016-07-18 04:27:29 +02:00
committed by Guido van Rossum
parent cf655f6f02
commit d5938ee76c
2 changed files with 196 additions and 157 deletions

View File

@@ -250,3 +250,25 @@ if sys.version_info >= (3, 5):
def read(self, n: int = ...) -> bytes: ...
def write(self, buf: bytes) -> int: ...
def write_eof(self) -> None: ...
# TODO below documented in cpython but not in docs.python.org
# taken from python 3.4
SSL_ERROR_EOF = ... # type: int
SSL_ERROR_INVALID_ERROR_CODE = ... # type: int
SSL_ERROR_SSL = ... # type: int
SSL_ERROR_SYSCALL = ... # type: int
SSL_ERROR_WANT_CONNECT = ... # type: int
SSL_ERROR_WANT_READ = ... # type: int
SSL_ERROR_WANT_WRITE = ... # type: int
SSL_ERROR_WANT_X509_LOOKUP = ... # type: int
SSL_ERROR_ZERO_RETURN = ... # type: int
def get_protocol_name(protocol_code: int) -> str: ...
AF_INET = ... # type: int
PEM_FOOTER = ... # type: str
PEM_HEADER = ... # type: str
SOCK_STREAM = ... # type: int
SOL_SOCKET = ... # type: int
SO_TYPE = ... # type: int