diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-01-13 08:49:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 13:49:28 +0000 |
commit | 10a88ba91cb16ccf757984f0a7d41ddf8b4dc07f (patch) | |
tree | 1b97b98f60f33e690e9dcc4156ebafdd2617fe26 /synapse/rest | |
parent | Fix typo in demo docs: differnt (#11735) (diff) | |
download | synapse-10a88ba91cb16ccf757984f0a7d41ddf8b4dc07f.tar.xz |
Use auto_attribs/native type hints for attrs classes. (#11692)
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/media/v1/media_storage.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/rest/media/v1/media_storage.py b/synapse/rest/media/v1/media_storage.py index fca239d8c7..9f6c251caf 100644 --- a/synapse/rest/media/v1/media_storage.py +++ b/synapse/rest/media/v1/media_storage.py @@ -343,7 +343,7 @@ class SpamMediaException(NotFoundError): """ -@attr.s(slots=True) +@attr.s(slots=True, auto_attribs=True) class ReadableFileWrapper: """Wrapper that allows reading a file in chunks, yielding to the reactor, and writing to a callback. @@ -354,8 +354,8 @@ class ReadableFileWrapper: CHUNK_SIZE = 2 ** 14 - clock = attr.ib(type=Clock) - path = attr.ib(type=str) + clock: Clock + path: str async def write_chunks_to(self, callback: Callable[[bytes], None]) -> None: """Reads the file in chunks and calls the callback with each chunk.""" |