From 15df9512ffc9e0d167ed66a3267bc9b0a03ee517 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Sun, 6 Oct 2019 04:55:49 +0530 Subject: [PATCH 1/3] imaplib.pyi: Add ssl_context parameter for Python >= 3.3 Fixes: #3289 --- stdlib/2and3/imaplib.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/2and3/imaplib.pyi b/stdlib/2and3/imaplib.pyi index c22a47533355..6460b27b327d 100644 --- a/stdlib/2and3/imaplib.pyi +++ b/stdlib/2and3/imaplib.pyi @@ -89,7 +89,11 @@ class IMAP4: class IMAP4_SSL(IMAP4): keyfile: str = ... certfile: str = ... - def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... + ssl_context: str = ... + if sys.version_info >= (3, 3): + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[str] = ...) -> None: ... + else: + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... host: str = ... port: int = ... sock: _socket = ... From 5ababde64fae9ca4cd1556bde9547a21e04657c0 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Sun, 6 Oct 2019 17:29:49 +0530 Subject: [PATCH 2/3] imaplib.pyi: Add ssl_context parameter for Python >= 3.3 Fixes: #3289 --- stdlib/2and3/imaplib.pyi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stdlib/2and3/imaplib.pyi b/stdlib/2and3/imaplib.pyi index 6460b27b327d..32e381ed3a11 100644 --- a/stdlib/2and3/imaplib.pyi +++ b/stdlib/2and3/imaplib.pyi @@ -5,7 +5,7 @@ import subprocess import sys import time from socket import socket as _socket -from ssl import SSLSocket +from ssl import SSLSocket, SSLContext from typing import Any, Callable, Dict, IO, List, Optional, Pattern, Text, Tuple, Type, Union CommandResults = Tuple[str, List[Any]] @@ -89,9 +89,8 @@ class IMAP4: class IMAP4_SSL(IMAP4): keyfile: str = ... certfile: str = ... - ssl_context: str = ... if sys.version_info >= (3, 3): - def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[str] = ...) -> None: ... + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[ssl.SSLContext] = ...) -> None: ... else: def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... host: str = ... From 499300cb6cb9dab076e5d368cc49e0ab26a6a13a Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Sun, 6 Oct 2019 21:32:19 +0530 Subject: [PATCH 3/3] imaplib.pyi: Add ssl_context parameter for Python >= 3.3 Fixes: #3289 --- stdlib/2and3/imaplib.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/imaplib.pyi b/stdlib/2and3/imaplib.pyi index 32e381ed3a11..d24070312724 100644 --- a/stdlib/2and3/imaplib.pyi +++ b/stdlib/2and3/imaplib.pyi @@ -90,7 +90,7 @@ class IMAP4_SSL(IMAP4): keyfile: str = ... certfile: str = ... if sys.version_info >= (3, 3): - def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[ssl.SSLContext] = ...) -> None: ... + def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[SSLContext] = ...) -> None: ... else: def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... host: str = ...