(self)
| 156 | return await handler.download_request(request) |
| 157 | |
| 158 | async def _close(self) -> None: |
| 159 | for dh in self._handlers.values(): |
| 160 | if not hasattr(dh, "close"): # pragma: no cover |
| 161 | warnings.warn( |
| 162 | f"{global_object_name(dh)} doesn't define a close() method." |
| 163 | f" This is deprecated, please add an empty 'async def close()' method.", |
| 164 | category=ScrapyDeprecationWarning, |
| 165 | stacklevel=1, |
| 166 | ) |
| 167 | continue |
| 168 | |
| 169 | if inspect.iscoroutinefunction(dh.close): |
| 170 | await dh.close() |
| 171 | else: # pragma: no cover |
| 172 | warnings.warn( |
| 173 | f"{global_object_name(dh.close)} is not a coroutine function." |
| 174 | f" This is deprecated, please rewrite it to return a coroutine.", |
| 175 | category=ScrapyDeprecationWarning, |
| 176 | stacklevel=1, |
| 177 | ) |
| 178 | await ensure_awaitable(dh.close()) |
nothing calls this directly
no test coverage detected