Fixed wrap from taking negative values
Now for wrap input it will take only postive integers as an input and if any negative numbers are give it will give output as "Wrap argument should be a positive integer". Change-Id: I1e62687d65144c16518cdae4c90cf1617ff4cc2d
This commit is contained in:
parent
c40c25c589
commit
5f3d111dbf
@ -216,6 +216,8 @@ def print_dict(dct, dict_property="Property", wrap=0):
|
||||
v = six.text_type(keys_and_vals_to_strs(v))
|
||||
if wrap > 0:
|
||||
v = textwrap.fill(six.text_type(v), wrap)
|
||||
elif wrap < 0:
|
||||
raise ValueError(_("Wrap argument should be a positive integer"))
|
||||
# if value has a newline, add in multiple rows
|
||||
# e.g. fault with stacktrace
|
||||
if v and isinstance(v, six.string_types) and r'\n' in v:
|
||||
|
Loading…
Reference in New Issue
Block a user