From 220a8d1be943381be6190a71438f601658b595e0 Mon Sep 17 00:00:00 2001 From: Andrew Soutar Date: Fri, 28 Jan 2022 13:57:21 -0500 Subject: [PATCH] Add __enter__/__exit__ to pymysql.Connection (#7069) --- stubs/PyMySQL/pymysql/connections.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stubs/PyMySQL/pymysql/connections.pyi b/stubs/PyMySQL/pymysql/connections.pyi index 2ec680f83..2b2b49d0a 100644 --- a/stubs/PyMySQL/pymysql/connections.pyi +++ b/stubs/PyMySQL/pymysql/connections.pyi @@ -1,3 +1,4 @@ +from _typeshed import Self from socket import socket as _socket from typing import Any, AnyStr, Generic, Mapping, TypeVar, overload @@ -195,6 +196,8 @@ class Connection(Generic[_C]): def get_proto_info(self): ... def get_server_info(self): ... def show_warnings(self): ... + def __enter__(self: Self) -> Self: ... + def __exit__(self, *exc_info: object) -> None: ... Warning: Any Error: Any InterfaceError: Any