aboutcode-org / aboutcode-org/vulnerablecode
fix: Replace bare [except] with explicit `Exception` in pipes/advisory.py
- Langage dominant
- Python
- Étoiles
- 702
- Forks
- 328
- Merge moyen
- 3 j 8 h
- PR mergées (30 j)
- 3
Description
## Summary
The file [vulnerabilities/pipes/advisory.py] contains a bare `except:` clause at line 459 which violates PEP 8 (E722) and can lead to unexpected behavior.
## Problem
Bare `except:` clauses catch **all** exceptions, including:
- `SystemExit` - prevents clean program termination
- `KeyboardInterrupt` - prevents Ctrl+C from working
- `GeneratorExit` - can break generator cleanup
## Location
**File:** [vulnerabilities/pipes/advisory.py]
**Line:** 459
**Current code:**
```python
except:
if logger:
logger(
f"Failed to create VulnerabilitySeverity for: {severity} with error:\n{traceback_format_exc()}",
level=logging.ERROR,
)
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.