Skip to content

Commit

Permalink
Properly fill in __exit__ args
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Nov 1, 2023
1 parent 262886a commit 80c6d31
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/wheel_inspect/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import pathlib
import sys
from types import TracebackType
from typing import IO, Any, Mapping, Optional, TextIO, TypeVar, Union, overload
from zipfile import ZipFile
import attr
Expand Down Expand Up @@ -53,7 +54,12 @@ class DistInfoProvider(abc.ABC):
def __enter__(self: T) -> T:
return self

def __exit__(self, *_exc: Any) -> Optional[bool]: # noqa: B027
def __exit__( # noqa: B027
self,
_exc_type: type[BaseException] | None,
_exc_val: BaseException | None,
_exc_tb: TracebackType | None,
) -> Optional[bool]:
pass

def validate(self) -> None:
Expand Down Expand Up @@ -544,7 +550,12 @@ def from_zipfile(cls, zipfile: ZipFile, strict: bool = True) -> WheelFile:
def __enter__(self) -> WheelFile:
return self

def __exit__(self, *_exc: Any) -> None:
def __exit__(
self,
_exc_type: type[BaseException] | None,
_exc_val: BaseException | None,
_exc_tb: TracebackType | None,
) -> None:
self.close()

def close(self) -> None:
Expand Down

0 comments on commit 80c6d31

Please sign in to comment.