Skip to content

fix: Replace bare [except] with explicit Exception in pipes/advisory.py #2074

Description

@samay2504

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:

except:
    if logger:
        logger(
            f"Failed to create VulnerabilitySeverity for: {severity} with error:\n{traceback_format_exc()}",
            level=logging.ERROR,
        )

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions