Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39164: errors: add and expose _PyErr_GetExcInfo #17752

Merged
merged 1 commit into from Jan 13, 2020

Conversation

@jd
Copy link
Contributor

jd commented Dec 30, 2019

This adds a new function named _PyErr_GetExcInfo that is a variation of the
original PyErr_GetExcInfo taking a PyThreadState as its first argument.
That function allows to retrieve the exceptions information of any Python
thread — not only the current one.

https://bugs.python.org/issue39164

@jd

This comment has been minimized.

Copy link
Contributor Author

jd commented Jan 13, 2020

@vstinner just in case you missed it 👋 :)

Python/errors.c Outdated Show resolved Hide resolved
Python/errors.c Show resolved Hide resolved
Include/pyerrors.h Outdated Show resolved Hide resolved
This adds a new function named _PyErr_GetExcInfo that is a variation of the
original PyErr_GetExcInfo taking a PyThreadState as its first argument.
That function allows to retrieve the exceptions information of any Python
thread — not only the current one.
@jd jd force-pushed the jd:expose-PyErr_GetExcInfo branch from 76d6cbf to 1b19a83 Jan 13, 2020
@jd jd requested a review from vstinner Jan 13, 2020
@jd

This comment has been minimized.

Copy link
Contributor Author

jd commented Jan 13, 2020

Failure looks unrelated 🤔

@vstinner

This comment has been minimized.

Copy link
Member

vstinner commented Jan 13, 2020

test_ttk_guionly failed twice on Azure Pipelines "Tests / Ubuntu":

...
1 test failed:
    test_ttk_guionly
...
0:09:11 load avg: 1.55 Re-running test_ttk_guionly in verbose mode
patchlevel = 8.6.8
...
test_values (tkinter.test.test_ttk.test_widgets.ComboboxTest) ... ok
test_virtual_event (tkinter.test.test_ttk.test_widgets.ComboboxTest) ... Timeout (0:20:00)!
Thread 0x00007fb9e022b080 (most recent call first):
  File "/home/runner/work/cpython/cpython/Lib/tkinter/__init__.py", line 697 in wait_visibility
  File "/home/runner/work/cpython/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 452 in test_virtual_event
  File "/home/runner/work/cpython/cpython/Lib/unittest/case.py", line 616 in _callTestMethod
  ...
@vstinner vstinner merged commit 3430c55 into python:master Jan 13, 2020
8 of 9 checks passed
8 of 9 checks passed
Docs
Details
Windows (x86)
Details
Windows (x64)
Details
macOS
Details
Ubuntu Ubuntu
Details
Azure Pipelines PR #20200113.34 succeeded
Details
bedevere/issue-number Issue number 39164 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vstinner

This comment has been minimized.

Copy link
Member

vstinner commented Jan 13, 2020

Thanks @jd, I merged your PR. I made minor changes on your commit message.

@jd jd deleted the jd:expose-PyErr_GetExcInfo branch Jan 13, 2020
@jd

This comment has been minimized.

Copy link
Contributor Author

jd commented Jan 13, 2020

Thank you @vstinner 🙇

PyErr_GetExcInfo(PyObject **p_type, PyObject **p_value, PyObject **p_traceback)
{
PyThreadState *tstate = _PyThreadState_GET();
return _PyErr_GetExcInfo(tstate, p_type, p_value, p_traceback);

This comment has been minimized.

Copy link
@ammaraskar

ammaraskar Jan 15, 2020

Member

Should this have a return? I think this introduced a warning on the windows build: https://github.com/python/cpython/runs/390021032#step:3:572

This comment has been minimized.

Copy link
@vstinner

vstinner Jan 15, 2020

Member

You're right. I wrote PR #18010 to fix the warning.

petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 2020
This adds a new function named _PyErr_GetExcInfo() that is a variation of the
original PyErr_GetExcInfo() taking a PyThreadState as its first argument.
That function allows to retrieve the exceptions information of any Python
thread -- not only the current one.
petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 2020
This adds a new function named _PyErr_GetExcInfo() that is a variation of the
original PyErr_GetExcInfo() taking a PyThreadState as its first argument.
That function allows to retrieve the exceptions information of any Python
thread -- not only the current one.
petdance added a commit to petdance/cpython that referenced this pull request Jan 17, 2020
This adds a new function named _PyErr_GetExcInfo() that is a variation of the
original PyErr_GetExcInfo() taking a PyThreadState as its first argument.
That function allows to retrieve the exceptions information of any Python
thread -- not only the current one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.