Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve syntax error for try block without finally or except block #88471

Closed
pablogsal opened this issue Jun 3, 2021 · 3 comments
Closed

Improve syntax error for try block without finally or except block #88471

pablogsal opened this issue Jun 3, 2021 · 3 comments

Comments

@pablogsal
Copy link
Member

BPO 44305
Nosy @pablogsal
PRs
  • bpo-44305: Improve syntax error for try blocks without except or finally #26523
  • [3.10] bpo-44305: Improve syntax error for try blocks without except … #26524
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-06-03.22:53:44.991>
    created_at = <Date 2021-06-03.21:48:37.462>
    labels = []
    title = 'Improve syntax error for try block without finally or except block'
    updated_at = <Date 2021-06-03.23:11:51.484>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2021-06-03.23:11:51.484>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-06-03.22:53:44.991>
    closer = 'pablogsal'
    components = []
    creation = <Date 2021-06-03.21:48:37.462>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44305
    keywords = ['patch']
    message_count = 3.0
    messages = ['395053', '395056', '395057']
    nosy_count = 1.0
    nosy_names = ['pablogsal']
    pr_nums = ['26523', '26524']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44305'
    versions = []

    @pablogsal
    Copy link
    Member Author

    Given this script:
    try:
    x = 34

    a = 1

    instead of printing:
    File "/home/pablogsal/github/python/master/lel.py", line 4
    a = 1
    ^
    SyntaxError: invalid syntax

    we should print:

    File "/home/pablogsal/github/python/master/lel.py", line 4
    a = 1
    ^
    SyntaxError: expected 'except' or 'finally' block

    @pablogsal
    Copy link
    Member Author

    New changeset b250f89 by Pablo Galindo in branch 'main':
    bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523)
    b250f89

    @pablogsal
    Copy link
    Member Author

    New changeset e53f72a by Pablo Galindo in branch '3.10':
    [3.10] bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523) (GH-26524)
    e53f72a

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    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

    No branches or pull requests

    1 participant