Skip to content

fix: replace 5 bare except clauses with except Exception#2672

Merged
rwightman merged 1 commit intohuggingface:mainfrom
haosenwang1018:fix/bare-excepts
Feb 25, 2026
Merged

fix: replace 5 bare except clauses with except Exception#2672
rwightman merged 1 commit intohuggingface:mainfrom
haosenwang1018:fix/bare-excepts

Conversation

@haosenwang1018
Copy link
Copy Markdown
Contributor

What

Replace 5 bare except: clauses with except Exception:.

Why

Bare except: catches BaseException, including KeyboardInterrupt and SystemExit, which can prevent clean process shutdown and mask critical errors.

Bare `except:` catches BaseException including KeyboardInterrupt and
SystemExit. Replaced 5 instances with `except Exception:`.
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@rwightman rwightman merged commit 2845814 into huggingface:main Feb 25, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants