mypy issue: VimFault is not derived from BaseException
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 763
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When we run some of our code through mypy, it reports the following issue:
error: Exception type must be derived from BaseException (or be a tuple of exception classes) [misc]
Here's a simplified example:
from pyVmomi import vim
try:
pass
except vim.fault.VimFault:
pass
Reproduction steps
- Write code that tries to catch
vim.fault.VimFaultexceptions - Run mypy against the code
Expected behavior
No mypy errors
Additional context
pyvmomi==8.0.3.0.1
mypy==1.11.1
Python 3.10.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the definition and generated hierarchy for pyVmomi's vim.fault.VimFault, then reproduce the minimal example with Python 3.10.6, pyvmomi 8.0.3.0.1, and mypy 1.11.1. Done means mypy accepts an except clause catching VimFault without reporting the BaseException error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100