Raise TypeError instead of ValueError for invalid types (#38660)

* Raise TypeError instead of ValueError for invalid types.

* Removed un-necessary changes.

* Resolved conflicts

* Code quality

* Fix failing tests.

* Fix failing tests.
This commit is contained in:
Sai-Suraj-27
2025-07-21 18:12:00 +05:30
committed by GitHub
parent 822c5e45b2
commit 970d9a75ce
45 changed files with 48 additions and 50 deletions

View File

@@ -61,7 +61,7 @@ def generate_fake_bounding_boxes(n_boxes):
"""Generate bounding boxes in the format (center_x, center_y, width, height)"""
# Validate the input
if not isinstance(n_boxes, int):
raise ValueError("n_boxes must be an integer")
raise TypeError("n_boxes must be an integer")
if n_boxes <= 0:
raise ValueError("n_boxes must be a positive integer")