Skip to content

Commit 182c594

Browse files
Merge pull request #1844 from VWS-Python/cv2-macos
Suppress incorrect error which shows up on pylint + macOS
2 parents 2638ba9 + 336159d commit 182c594

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/mock_vws/target_raters.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ def _get_brisque_target_tracking_rating(image_content: bytes) -> int:
3232
with np.errstate(divide="ignore", invalid="ignore"):
3333
try:
3434
score = brisque_obj.score(img=image_array)
35+
# See https://github.com/pylint-dev/pylint/issues/9332
36+
# for why we disable these warnings - pylint has trouble with
37+
# cv2.error and behaves differently depending on the OS.
38+
# pylint: disable=catching-non-exception, useless-suppression
3539
except (cv2.error, ValueError):
40+
# pylint: enable=catching-non-exception, useless-suppression
3641
return 0
3742
if math.isnan(score):
3843
return 0

0 commit comments

Comments
 (0)