fix using ZipFile as a ContextManager (#2043)

This commit is contained in:
Jelle Zijlstra authored and Łukasz Langa committed 2018-04-12 12:29:22 -07:00
1 parent b8b78886e3
commit 37aba00fe8
6 files changed
+18 -18

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
# Stubs for ftplib (Python 2.7/3)
import sys
from typing import Optional, BinaryIO, Tuple, TextIO, Iterable, Callable, List, Union, Iterator, Dict, Text, TypeVar, Generic, Any
from typing import Optional, BinaryIO, Tuple, TextIO, Iterable, Callable, List, Union, Iterator, Dict, Text, Type, TypeVar, Generic, Any
from types import TracebackType
from socket import socket
from ssl import SSLContext
@@ -43,7 +43,7 @@ class FTP:
file = ... # type: Optional[TextIO]
encoding = ... # type: str
def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type: Optional[type], exc_val: Optional[Exception],
def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool: ...
else:
file = ... # type: Optional[BinaryIO]
+1 -1
View File
@@ -26,7 +26,7 @@ class ZipFile:
allowZip64: bool = ...) -> None: ...
def __enter__(self) -> ZipFile: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[Exception],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool: ...
def close(self) -> None: ...
def getinfo(self, name: Text) -> ZipInfo: ...