Skip to content

Improve raise from ValueError() error message #134036

Closed
@sobolevn

Description

@sobolevn

Feature or enhancement

#133999 gave me an idea. Right now it is:

Image

I suggest making it something similar to:

>>> raise from ValueError
  File "<python-input-1>", line 1
    raise from ValueError
          ^^
SyntaxError: invalid syntax, maybe you forgot an exception after `raise` keyword?

Wording is not the best at the moment, but we will figure it out :)

Linked PRs

Activity

self-assigned this
on May 15, 2025
added
type-featureA feature request or enhancement
interpreter-core(Objects, Python, Grammar, and Parser dirs)
3.15new features, bugs and security fixes
on May 15, 2025
removed
3.15new features, bugs and security fixes
on May 15, 2025
added a commit that references this issue on May 16, 2025

pythongh-134036: Improve error messages for invalid `raise` statements

d8c385a
added a commit that references this issue on Jun 6, 2025

gh-134036: Improve error messages for invalid `raise` statements (#13…

0d9ccc8
added a commit that references this issue on Jun 6, 2025

pythongh-134036: Update test_syntax

added a commit that references this issue on Jun 6, 2025

gh-134036: Update test_syntax for gh-133999 (#135204)

82415ac
ZeroIntensity

ZeroIntensity commented on Jun 11, 2025

@ZeroIntensity
Member

Triage: everything done here?

1 remaining item

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Improve `raise from ValueError()` error message · Issue #134036 · python/cpython

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant