From 931361516ae415084ba185a90a94c80471c9b83e Mon Sep 17 00:00:00 2001 From: Thomas Ballinger Date: Thu, 6 Nov 2025 20:58:36 -0800 Subject: [PATCH] Fix TypeError in area replace error message --- curtsies/formatstringarray.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/curtsies/formatstringarray.py b/curtsies/formatstringarray.py index d63171f..efbb81a 100644 --- a/curtsies/formatstringarray.py +++ b/curtsies/formatstringarray.py @@ -171,19 +171,21 @@ def __setitem__(self, slicetuple, value): msg = "You are trying to fit this value {} into the region {}: {}".format( fmtstr("".join(value), bg="cyan"), fmtstr("").join(grid_value), - "\n ".join(grid_fsarray[x] for x in range(len(self.rows))), + fmtstr("\n ").join(grid_fsarray[x] for x in range(len(self.rows))), ) raise ValueError( - """Error you are trying to replace a region of {} rows by {} - columns for and area of {} with a value of len {}. The value - used to replace the region must equal the area of the region - replace. - {}""".format( + """{} +You are trying to replace a region of {} rows by {} +columns and area {} with a region of {} rows and total +area of {}. The value used to replace the region must equal the +area of the region replaced. +""".format( + msg, rowslice.stop - rowslice.start, colslice.stop - colslice.start, area, + len(value), val_len, - msg, ) ) self.rows = (