Skip to content

Commit

Permalink
upgrade pyre version in fbcode/fair_infra - batch 1
Browse files Browse the repository at this point in the history
Differential Revision: D43044299

fbshipit-source-id: 5c873a3789bc1945f5d867a65979600190f29959
  • Loading branch information
generatedunixname89002005307016 authored and facebook-github-bot committed Feb 6, 2023
1 parent 60e2c93 commit 29c5224
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
10 changes: 0 additions & 10 deletions iopath/common/azure_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def _get_chunk_data(self, size: int) -> bytes:
def seekable(self) -> bool:
return False

# pyre-fixme[14]: `seek` overrides method defined in `IOBase` inconsistently.
def seek(self, offset: int, whence: int = os.SEEK_SET) -> int:
raise io.UnsupportedOperation()

Expand All @@ -139,7 +138,6 @@ def tell(self) -> int:
def readable(self) -> bool:
return True

# pyre-fixme[14]: `read` overrides method defined in `RawIOBase` inconsistently.
def read(self, size: int = -1) -> bytes:
if size < 0:
return self.readall()
Expand All @@ -151,7 +149,6 @@ def readall(self) -> bytes:
return stream.getvalue()

# pyre-ignore[2]: stream is any bytes-like object
# pyre-fixme[14]: `readinto` overrides method defined in `RawIOBase` inconsistently.
def readinto(self, stream) -> None:
size = self._chunk_size
data = self._get_chunk_data(size)
Expand All @@ -164,11 +161,9 @@ def writeable(self) -> bool:
return False

# pyre-ignore[2]: b is any bytes-like object
# pyre-fixme[14]: `write` overrides method defined in `RawIOBase` inconsistently.
def write(self, b) -> int:
raise io.UnsupportedOperation()

# pyre-fixme[14]: `truncate` overrides method defined in `IOBase` inconsistently.
def truncate(self, size: Optional[int]) -> int:
raise io.UnsupportedOperation()

Expand Down Expand Up @@ -222,7 +217,6 @@ def _append_to_chunk(self, b: bytes) -> int:
def seekable(self) -> bool:
return False

# pyre-fixme[14]: `seek` overrides method defined in `IOBase` inconsistently.
def seek(self, offset: int, whence: int = os.SEEK_SET) -> int:
raise io.UnsupportedOperation()

Expand All @@ -232,27 +226,23 @@ def tell(self) -> int:
def readable(self) -> bool:
return False

# pyre-fixme[14]: `read` overrides method defined in `RawIOBase` inconsistently.
def read(self, size: int = -1) -> bytes:
raise io.UnsupportedOperation()

def readall(self) -> bytes:
raise io.UnsupportedOperation()

# pyre-ignore[2]: stream is any bytes-like object
# pyre-fixme[14]: `readinto` overrides method defined in `RawIOBase` inconsistently.
def readinto(self, stream) -> None:
raise io.UnsupportedOperation()

def writeable(self) -> bool:
return True

# pyre-ignore[2]: b is any bytes-like object
# pyre-fixme[14]: `write` overrides method defined in `RawIOBase` inconsistently.
def write(self, b) -> int:
return self._append_to_chunk(b)

# pyre-fixme[14]: `truncate` overrides method defined in `IOBase` inconsistently.
def truncate(self, size: Optional[int]) -> int:
raise io.UnsupportedOperation()

Expand Down
3 changes: 0 additions & 3 deletions iopath/common/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ def _copy_from_local(
src_path=local_path, dst_path=dst_path, overwrite=overwrite, **kwargs
)

# pyre-fixme[14]: `_open` overrides method defined in `PathHandler` inconsistently.
def _open(
self,
path: str,
Expand Down Expand Up @@ -804,8 +803,6 @@ def __init__(self) -> None:
def _get_supported_prefixes(self) -> List[str]:
return ["http://", "https://", "ftp://"]

# pyre-fixme[14]: `_get_local_path` overrides method defined in `PathHandler`
# inconsistently.
def _get_local_path(
self,
path: str,
Expand Down
1 change: 0 additions & 1 deletion iopath/common/non_blocking_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ def write(self, b: Union[bytes, bytearray]) -> None:
# bytes]`.
self._notify_manager(lambda: self._io.write(b))

# pyre-fixme[14]: `seek` overrides method defined in `IOBase` inconsistently.
def seek(self, offset: int, whence: int = 0) -> int:
"""
Called on `f.seek()`.
Expand Down
5 changes: 0 additions & 5 deletions iopath/common/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,6 @@ def _decorate_buf_with_s3_methods(
# IO[str])], None], IO[str]]]`; used as `MethodType`.
buffer.close = types.MethodType(fn, buffer)

# pyre-fixme[14]: `_open` overrides method defined in `PathHandler` inconsistently.
def _open(
self,
path: str,
Expand Down Expand Up @@ -682,7 +681,6 @@ def writable(self) -> bool:
def fileno(self) -> int:
raise AttributeError()

# pyre-fixme[14]: `seek` overrides method defined in `IOBase` inconsistently.
def seek(self, offset: int, whence: int = 0) -> int:
"""
Change stream position.
Expand Down Expand Up @@ -712,7 +710,6 @@ def tell(self) -> int:
"""Return an int indicating the current stream position."""
return self.offset

# pyre-fixme[14]: `truncate` overrides method defined in `IOBase` inconsistently.
def truncate(self, size: Optional[int] = None) -> int:
"""
Truncate file to size bytes.
Expand All @@ -739,8 +736,6 @@ def close(self) -> None:
"""
pass

# pyre-fixme[14]: `read1` overrides method defined in `BufferedIOBase`
# inconsistently.
def read1(self, size: int = -1) -> bytes:
return self.read(size)

Expand Down

0 comments on commit 29c5224

Please sign in to comment.