Skip to content

fix: fix: use proper exception objects instead of bare raise/assert strings - #14516

Open
Ricardo-M-L wants to merge 1 commit into
huggingface:mainfrom
Ricardo-M-L:fix/raise-string-to-raise-exception-clean
Open

fix: fix: use proper exception objects instead of bare raise/assert strings#14516
Ricardo-M-L wants to merge 1 commit into
huggingface:mainfrom
Ricardo-M-L:fix/raise-string-to-raise-exception-clean

Conversation

@Ricardo-M-L

Copy link
Copy Markdown
Contributor

Clean rebase

- attention_processor.py: `raise "string"` causes TypeError at runtime.
  Changed 3 occurrences to `raise RuntimeError("...")`.
- pipeline_stable_diffusion_3_controlnet_inpainting.py:
  `assert ValueError("...")` always passes (ValueError object is truthy).
  Changed to `raise ValueError("...")`.
@github-actions github-actions Bot added size/S PR with diff < 50 LOC models pipelines and removed size/S PR with diff < 50 LOC labels Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @Ricardo-M-L, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. Fixes #1234) to the PR description so the issue is linked. See the contribution guide for more details. If this PR intentionally does not fix a tracked issue, a maintainer can add the no-issue-needed label to silence this reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant