mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #23776: Removed asserts from pprint.PrettyPrinter constructor.
This commit is contained in:
parent
e6bb7eb27b
commit
f3fa308817
2 changed files with 24 additions and 8 deletions
|
@ -124,9 +124,12 @@ class PrettyPrinter:
|
|||
"""
|
||||
indent = int(indent)
|
||||
width = int(width)
|
||||
assert indent >= 0, "indent must be >= 0"
|
||||
assert depth is None or depth > 0, "depth must be > 0"
|
||||
assert width, "width must be != 0"
|
||||
if indent < 0:
|
||||
raise ValueError('indent must be >= 0')
|
||||
if depth is not None and depth <= 0:
|
||||
raise ValueError('depth must be > 0')
|
||||
if not width:
|
||||
raise ValueError('width must be != 0')
|
||||
self._depth = depth
|
||||
self._indent_per_level = indent
|
||||
self._width = width
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue