summaryrefslogtreecommitdiff
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-11-28 07:27:28 -0700
committerGitHub <noreply@github.com>2020-11-28 16:27:28 +0200
commit8085f742f4adfbc85f13fc734dfab036aa23acfb (patch)
treeee08b5f84d732556b0fde7d2adae42c7342445b0 /Lib/asyncio
parent5b0194ed31376382da63ad5b10271a4acc4a80e8 (diff)
downloadcpython-git-8085f742f4adfbc85f13fc734dfab036aa23acfb.tar.gz
bpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925)
Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/exceptions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/asyncio/exceptions.py b/Lib/asyncio/exceptions.py
index e03602ef57..f07e448657 100644
--- a/Lib/asyncio/exceptions.py
+++ b/Lib/asyncio/exceptions.py
@@ -34,8 +34,9 @@ class IncompleteReadError(EOFError):
- expected: total number of expected bytes (or None if unknown)
"""
def __init__(self, partial, expected):
+ r_expected = 'undefined' if expected is None else repr(expected)
super().__init__(f'{len(partial)} bytes read on a total of '
- f'{expected!r} expected bytes')
+ f'{r_expected} expected bytes')
self.partial = partial
self.expected = expected