From 717cd1f96f1df3f00b9e5e569d40ae5172ffd800 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Sun, 6 Oct 2019 22:27:22 +0530 Subject: [PATCH] imaplib.pyi: Add ssl_context parameter for Python >= 3.3 (#3310) Fixes: #3289 --- stdlib/2and3/imaplib.pyi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/imaplib.pyi b/stdlib/2and3/imaplib.pyi index c22a47533..d24070312 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,7 +89,10 @@ class IMAP4: class IMAP4_SSL(IMAP4): keyfile: str = ... certfile: str = ... - def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ... + if sys.version_info >= (3, 3): + 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 = ... port: int = ... sock: _socket = ...