Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback#102779

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iritkatriel merged 9 commits intopython:mainfromiritkatriel:sys-last-exc
Mar 18, 2023

Conversation

@iritkatriel
Copy link
Member

@iritkatrieliritkatriel commentedMar 17, 2023
edited by bedevere-bot
Loading

iritkatrieland others added2 commitsMarch 17, 2023 13:51
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Copy link
Member

@AlexWaygoodAlexWaygood left a comment

Choose a reason for hiding this comment

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

A few more docs nits

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@iritkatrieliritkatriel added the 🔨 test-with-refleak-buildbotsTest PR w/ refleak buildbots; report in status section labelMar 17, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@iritkatriel for commite1cc312 🤖

If you want to schedule another build, you need to add the🔨 test-with-refleak-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-refleak-buildbotsTest PR w/ refleak buildbots; report in status section labelMar 17, 2023
Copy link
Member

@gvanrossumgvanrossum left a comment

Choose a reason for hiding this comment

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

Shouldn’t pdb.pm() be changed to use sys.last_exc?

@iritkatriel
Copy link
MemberAuthor

Shouldn’t pdb.pm() be changed to use sys.last_exc?

Yes, idlelib too. But I'm not sure whether we do that now or in 3.14 when it won't interfere with backports.

@gvanrossum
Copy link
Member

Shouldn’t pdb.pm() be changed to use sys.last_exc?

Yes, idlelib too. But I'm not sure whether we do that now or in 3.14 when it won't interfere with backports.

I would do it now, but look both (in case user code sets one or the other): if sys.last_exc exists, use that, else if sys.last_(type,value,traceback) exist, use those, else fail. Then in the future we can delete the code checking for the latter.

iritkatriel reacted with thumbs up emoji

@iritkatrieliritkatriel added the 🔨 test-with-refleak-buildbotsTest PR w/ refleak buildbots; report in status section labelMar 17, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@iritkatriel for commit2ce2c26 🤖

If you want to schedule another build, you need to add the🔨 test-with-refleak-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-refleak-buildbotsTest PR w/ refleak buildbots; report in status section labelMar 17, 2023
@iritkatrieliritkatriel merged commite1e9bab intopython:mainMar 18, 2023
@terryjreedy
Copy link
Member

terryjreedy commentedMar 19, 2023
edited
Loading

Please revert the changes to idlelib. (Why the rush before I could respond.) I dislike the awkward workaround changes, which IDLE does not need, and they cannot be backported. I would much prefer to make more extensive changes that get rid of nearly all references to the deprecated attributes and whichcan be backported.

For instance, in test_stackviewer setup,replacesvs.last_type ... = svs.exec_info() withsvs.last_exc = svs.exec_info()[1]. In the teardown, replacedel ... withdel svs.last_exc, leaving no usage of the deprecated names. In other modules, addsys.last_exc = sys.last_value and eliminate all other uses of the old names. In June 2024, eliminate the use of last_value.

Let me request again (from the previous PR that was closed) that idlelib changes be put in a separate PR that I can review and backport.

@iritkatriel
Copy link
MemberAuthor

Sorry, will revert and fix.

@iritkatriel
Copy link
MemberAuthor

In other modules, addsys.last_exc = sys.last_value and eliminate all other uses of the old names.

If a user tries to access sys.last_type or sys.last_traceback then it won't work. Is this not an issue?

@iritkatrieliritkatriel deleted the sys-last-exc branchMarch 19, 2023 11:50
@terryjreedy
Copy link
Member

terryjreedy commentedMar 19, 2023
edited
Loading

Yes,sys.last_type, sys.last_value, sys.last_traceback = excinfo should remain as long as the REPL does the same. I should add a comment in the file. I believe other settings are only for internal use for stackviewer and its test, but will check.

Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull requestMar 27, 2023
warsaw pushed a commit to warsaw/cpython that referenced this pull requestApr 11, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AlexWaygoodAlexWaygoodAlexWaygood left review comments

@gvanrossumgvanrossumgvanrossum approved these changes

@terryjreedyterryjreedyAwaiting requested review from terryjreedyterryjreedy is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@iritkatriel@bedevere-bot@gvanrossum@terryjreedy@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp