diff options
Diffstat (limited to 'Lib/asyncio')
| -rw-r--r-- | Lib/asyncio/base_events.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index f532dc4213..7442bf28b0 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -1035,7 +1035,12 @@ class BaseEventLoop(events.AbstractEventLoop): except events.SendfileNotAvailableError as exc: if not fallback: raise - # the mode is FALLBACK or fallback is True + + if not fallback: + raise RuntimeError( + f"fallback is disabled and native sendfile is not " + f"supported for transport {transport!r}") + return await self._sendfile_fallback(transport, file, offset, count) |
