Skip to content

fix(scripts): use RuntimeError instead of bare string in demangle.py#413

Open
AmSach wants to merge 1 commit into
thepowersgang:masterfrom
AmSach:fix/demangle-py3-raise
Open

fix(scripts): use RuntimeError instead of bare string in demangle.py#413
AmSach wants to merge 1 commit into
thepowersgang:masterfrom
AmSach:fix/demangle-py3-raise

Conversation

@AmSach

@AmSach AmSach commented Jun 16, 2026

Copy link
Copy Markdown

scripts/demangle.py line 111 contains raise "error" which is Python 2 syntax and does not work in Python 3. Under Python 3, this raises a confusing TypeError: exceptions must derive from BaseException instead of the intended runtime error.

Before:

if next(c_iter) != 'g':
    raise "error"

After:

if next(c_iter) != 'g':
    raise RuntimeError("error")

This is a minimal, single-line fix that preserves the existing error semantics. The other raise statements in the file (e.g. raise Truncated(), raise Exception(...)) are already Python 3 compatible. — Sent via @AmSach bot

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.

1 participant