mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925) (GH-23539)
Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
(cherry picked from commit 8085f742f4
)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This commit is contained in:
parent
761c5a1ce4
commit
df6c8bcffe
3 changed files with 9 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue