GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-102799: use sys.exception() instead of sys.exc_info() in tests by iritkatriel · Pull Request #103293 · python/cpython

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Apr 5, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Now that 3.10 is no longer getting bugfixes, we can use sys.exception() without worrying about it impacting bugfix backports (it exists since 3.11).

This PR does the tests.

  • Issue: some usages of sys.exc_info can be replaced by more modern code #102799

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
iritkatriel added 8 commits April 5, 2023 18:43
@iritkatriel
test_exceptions
77ec662
@iritkatriel
test_generators 1
5641d25
@iritkatriel
test_generators 2
612be88
@iritkatriel
test_asyncio, test_class, test_logging
6d9da09
@iritkatriel
test_ssl, test/profilee
93fb191
@iritkatriel
test/support/asycore, test_(c)profile
ccfb27f
@iritkatriel
test_traceback
a5a78c2
@iritkatriel
test_asyncio
eb54ba5
@iritkatriel
iritkatriel requested review from 1st1, asvetlov, gvanrossum, kumaraditya303 and vsajip as code owners April 5, 2023 21:49
@bedevere-bot bedevere-bot added the awaiting core review label Apr 5, 2023
@bedevere-bot bedevere-bot mentioned this pull request Apr 5, 2023
some usages of sys.exc_info can be replaced by more modern code #102799
Closed
@iritkatriel iritkatriel added skip news tests Tests in the Lib/test dir labels Apr 5, 2023
gvanrossum
gvanrossum approved these changes Apr 6, 2023
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One nit, no need to wait for another approval after you fix it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/test/test_asyncio/test_tasks.py Outdated
timed_out
and task.uncancel() == 0
and sys.exc_info()[0] is asyncio.CancelledError
and isinstance(sys.exception(), asyncio.CancelledError)

@gvanrossum gvanrossum Apr 5, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Why add the isinstance() call? The original test insists that you get exactly CancelledError. I think that's useful to test for, since not all cancellation code is resilient to subclasses of CancelledError.

(In other cases below I don't mind.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iritkatriel and AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Apr 6, 2023
iritkatriel
iritkatriel commented Apr 6, 2023
View reviewed changes
Comment thread Lib/test/test_asyncio/test_tasks.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel
check exact type
4737b82
@iritkatriel
iritkatriel merged commit 482b6ee into python:main Apr 6, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Apr 6, 2023
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@iritkatriel @warsaw
pythongh-102799: use sys.exception() instead of sys.exc_info() in tes…
0888a42
…ts (python#103293)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@vsajip vsajip Awaiting requested review from vsajip vsajip is a code owner
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@kumaraditya303 kumaraditya303 Awaiting requested review from kumaraditya303 kumaraditya303 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@iritkatriel @gvanrossum @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.