Skip to content

Commit 9313615

Browse files
Fix TypeError in area replace error message
1 parent b2aaae8 commit 9313615

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

curtsies/formatstringarray.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,21 @@ def __setitem__(self, slicetuple, value):
171171
msg = "You are trying to fit this value {} into the region {}: {}".format(
172172
fmtstr("".join(value), bg="cyan"),
173173
fmtstr("").join(grid_value),
174-
"\n ".join(grid_fsarray[x] for x in range(len(self.rows))),
174+
fmtstr("\n ").join(grid_fsarray[x] for x in range(len(self.rows))),
175175
)
176176
raise ValueError(
177-
"""Error you are trying to replace a region of {} rows by {}
178-
columns for and area of {} with a value of len {}. The value
179-
used to replace the region must equal the area of the region
180-
replace.
181-
{}""".format(
177+
"""{}
178+
You are trying to replace a region of {} rows by {}
179+
columns and area {} with a region of {} rows and total
180+
area of {}. The value used to replace the region must equal the
181+
area of the region replaced.
182+
""".format(
183+
msg,
182184
rowslice.stop - rowslice.start,
183185
colslice.stop - colslice.start,
184186
area,
187+
len(value),
185188
val_len,
186-
msg,
187189
)
188190
)
189191
self.rows = (

0 commit comments

Comments
 (0)