Skip to content

gh-111609: Test end_offset in SyntaxError subclass - #127830

Merged
pablogsal merged 1 commit into
python:mainfrom
nineteendo:patch-1
Dec 11, 2024
Merged

pablogsal merged 1 commit into
python:mainfrom
nineteendo:patch-1

Conversation

@nineteendo

@nineteendo nineteendo commented Dec 11, 2024

Copy link
Copy Markdown
Contributor

This was fixed as a side effect of #110702, but wasn't tested.

class CustomSyntaxError(SyntaxError):
    pass

raise CustomSyntaxError("Error message", (None, 1, 5, 'a = sin(3)', 1, 9))

Output:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
    a = sin(3)
        ^^^^
CustomSyntaxError: Error message

@nineteendo

Copy link
Copy Markdown
Contributor Author

Peter, this test is already on 3.12, so doesn't need to be backported.

@nineteendo
nineteendo marked this pull request as ready for review December 11, 2024 15:54
Comment thread Lib/test/test_exceptions.py
@Eclips4 Eclips4 removed the needs backport to 3.12 only security fixes label Dec 11, 2024

@Eclips4 Eclips4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@pablogsal
pablogsal merged commit e8f4e27 into python:main Dec 11, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @nineteendo for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 11, 2024
…127830)

Test `end_offset` in SyntaxError subclass
(cherry picked from commit e8f4e27)

Co-authored-by: Nice Zombies <[email protected]>
@nineteendo
nineteendo deleted the patch-1 branch December 11, 2024 18:40
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
@hugovk hugovk added needs backport to 3.13 bugs and security fixes and removed needs backport to 3.13 bugs and security fixes labels Feb 21, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @nineteendo for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 21, 2025
…127830)

Test `end_offset` in SyntaxError subclass
(cherry picked from commit e8f4e27)

Co-authored-by: Nice Zombies <[email protected]>
@bedevere-app

bedevere-app Bot commented Feb 21, 2025

Copy link
Copy Markdown

GH-130407 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Feb 21, 2025
hugovk pushed a commit that referenced this pull request Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants