← 返回首页
bpo-45711: Remove type and traceback from exc_info by iritkatriel · Pull Request #30122 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

bpo-45711: Remove type and traceback from exc_info#30122

Merged
markshannon merged 16 commits into
python:mainfrom
iritkatriel:45711-exc_info_just_value
Dec 17, 2021
Merged

bpo-45711: Remove type and traceback from exc_info#30122
markshannon merged 16 commits into
python:mainfrom
iritkatriel:45711-exc_info_just_value

Conversation

iritkatriel commented Dec 15, 2021
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

iritkatriel changed the title 45711 exc info just value bpo-45711: Remove type and traceback from exc_info Dec 15, 2021
Comment thread Include/internal/pycore_pyerrors.h Outdated Show resolved Hide resolved
iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 15, 2021

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 9b04160 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 15, 2021
Comment thread Include/internal/pycore_pyerrors.h Outdated


/* number of items stored in the stack for each exception */
#define PY_EXC_INFO_STACK_SIZE 1

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Is this necessary now?
I don't see why we would ever want to increase it, and I don't see how we could ever decrease it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

The name is probably weird now, but I think it helps readability to have a macro. If we remove this we should find another way to make the code (particularly in compile.c) clear about where exceptions are showing up. Figuring out where to use this macro was the hardest part of making this change (because when you get it wrong it just segfaults before you finish make regen-all).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

On second thought there is no point in a macro for this unless we all agree on some kind of convention because it probably won't be updated correctly when people make changes. So I'll remove it.

Comment thread Lib/test/test_sys.py Show resolved Hide resolved
Comment thread Python/ceval.c Show resolved Hide resolved

Copy link
Copy Markdown
Member

This is great. 🍾

Removes code, should make any exception handling code faster and reduces stack consumption; the perfect combination.
A couple of very minor quibbles, otherwise looks really good.

Comment thread Python/compile.c Outdated Show resolved Hide resolved
Co-authored-by: Oleg Iarygin <dralife@yandex.ru>

Copy link
Copy Markdown
Member Author

The windows test failure is unrelated

File "D:\a\cpython\cpython\Lib\test\support_init_.py", line 197, in _force_run
1232
return func(*args)
1233
^^^^^^^^^^^
1234
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\a\cpython\cpython\build\test_python_4272�\test_python_worker_516�'

Copy link
Copy Markdown
Member

Excellent.

markshannon merged commit 396b583 into python:main Dec 17, 2021
iritkatriel deleted the 45711-exc_info_just_value branch January 13, 2022 15:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

5 participants

Footer

© 2026 GitHub, Inc.