Skip to content

fix: replace bare except clauses with except Exception#862

Merged
karmab merged 1 commit intokarmab:mainfrom
harshadkhetpal:fix/bare-except-expose-init
Apr 9, 2026
Merged

fix: replace bare except clauses with except Exception#862
karmab merged 1 commit intokarmab:mainfrom
harshadkhetpal:fix/bare-except-expose-init

Conversation

@harshadkhetpal
Copy link
Copy Markdown
Contributor

Summary

Replace 3 bare except: clauses with except Exception: in kvirt/expose/__init__.py (PEP 8 E722).

Why: Bare except: catches all exceptions including SystemExit, KeyboardInterrupt, and GeneratorExit. Since these blocks handle parse/load failures as fallbacks (not re-raising), except Exception: is the correct scope.

Changes:

# Before (lines 28, 107, 216)
except:
    continue  # or fallback assignment

# After
except Exception:
    continue  # or fallback assignment

Testing

No behavior change for normal operation — only prevents accidentally swallowing system-level exceptions.

@karmab karmab merged commit 4467d7e into karmab:main Apr 9, 2026
@karmab
Copy link
Copy Markdown
Owner

karmab commented Apr 9, 2026

Thanks!

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.

2 participants