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 — some usages of sys.exc_info can be replaced by more modern code · Issue #102799 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
some usages of sys.exc_info can be replaced by more modern code#102799
Copy link
Assignees
iritkatriel
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@iritkatriel
iritkatriel
opened on Mar 17, 2023
Issue body actions

There are some obvious places where sys.exc_info() can be replaced by direct access to a captured exception (without needing any new features that could complicate backports.)

Need to avoid changing tests that are testing exc_info, like generator tests or sys.

Linked PRs

  • gh-102799: remove unnecessary calls to sys.exc_info() in tests #102800
  • gh-102799: Let pydoc use the exception instead of sys.exc_info #102830
  • gh-102799: use exception instance instead of sys.exc_info() #102885
  • gh-102799: use sys.exception() instead of sys.exc_info() in tests #103293
  • gh-102799: use sys.exception() instead of sys.exc_info() in pdb #103294
  • gh-102799: use sys.exception() instead of sys.exc_info() in contextlib #103311
  • gh-102799: replace sys.exc_info by sys.exception in inspect and traceback modules #104032
  • gh-102799: replace internal sys.exc_info() call by sys.exception() #106746

Activity

Next
  1. iritkatriel
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Mar 17, 2023
  2. iritkatriel
    self-assigned this
    on Mar 17, 2023
  3. iritkatriel
    added 6 commits that reference this issue on Mar 17, 2023

    pythongh-102799: remove unnecessary calls to sys.exc_info() in tests

    1952868

    pythongh-102799: remove unnecessary calls to sys.exc_info() in tests

    fa3f31b

    gh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800)

    b3cc11a

    pythongh-102799: pydoc doesn't need to use sys.exc_info

    db6a8a9

    gh-102799: Let pydoc use the exception instead of sys.exc_info (#102830)

    868490e

    pythongh-102799: use exception instance instead of exc_info

    720a696
  4. Fidget-Spinner
    added 2 commits that reference this issue on Mar 27, 2023

    pythongh-102799: remove unnecessary calls to sys.exc_info() in tests (p…

    e2e5fa6

    pythongh-102799: Let pydoc use the exception instead of sys.exc_info (p…

    52172d3
  5. iritkatriel
    added a commit that references this issue on Mar 31, 2023

    gh-102799: use exception instance instead of sys.exc_info() (#102885)

    44bd3fe
  6. iritkatriel
    closed this as completedon Apr 3, 2023
  7. iritkatriel
    reopened this on Apr 5, 2023
  8. iritkatriel commented on Apr 5, 2023

    @iritkatriel
    iritkatriel
    on Apr 5, 2023
    MemberAuthor
    More actions

    Now that 3.10 is out of bugfix mode, we can use sys.exception() (which exists since 3.11, so would not cause issues with normal bugfix backports).

  9. 2 remaining items

  10. iritkatriel
    added 2 commits that reference this issue on Apr 6, 2023

    gh-102799: use sys.exception() instead of sys.exc_info() in tests (#1…

    482b6ee

    pythongh-102799: use sys.exception() instead of sys.exc_info() in con…

    ede88da
  11. kumaraditya303
    added a commit that references this issue on Apr 9, 2023

    gh-102799: use `sys.exception()` instead of `sys.exc_info()` in pdb (#…

    264b87f
  12. warsaw
    added 5 commits that reference this issue on Apr 11, 2023

    pythongh-102799: remove unnecessary calls to sys.exc_info() in tests (p…

    f624ea4

    pythongh-102799: Let pydoc use the exception instead of sys.exc_info (p…

    9a62a94

    pythongh-102799: use exception instance instead of sys.exc_info() (py…

    2f7d16a

    pythongh-102799: use sys.exception() instead of sys.exc_info() in tes…

    0888a42

    pythongh-102799: use `sys.exception()` instead of `sys.exc_info()` in…

    34379b3
  13. iritkatriel
    added 2 commits that reference this issue on May 1, 2023

    pythongh-102799: replace sys.exc_info by sys.exception in inspect and…

    e77f883

    gh-102799: replace sys.exc_info by sys.exception in inspect and trace…

    a679c3d
  14. carljm
    added a commit that references this issue on May 1, 2023

    Merge branch 'main' into inlinecomp2

    1274e2b
  15. iritkatriel
    added 2 commits that reference this issue on Jul 14, 2023

    pythongh-102799: replace internal sys.exc_info() call by sys.exception()

    f3c1848

    gh-102799: replace internal sys.exc_info() call by sys.exception() (#…

    fb32f35
  16. kumaraditya303
    added a commit that references this issue on Jul 20, 2023

    gh-102799: use sys.exception() instead of sys.exc_info() in contextlib (

    eeff8e7
  17. iritkatriel
    closed this as completedon Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @iritkatriel
    iritkatriel

Labels

stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.