Skip to content

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

Merged
vstinner merged 1 commit into
python:masterfrom
jd:expose-PyErr_GetExcInfo
Jan 13, 2020
Merged

bpo-39164: errors: add and expose _PyErr_GetExcInfo#17752
vstinner merged 1 commit into
python:masterfrom
jd:expose-PyErr_GetExcInfo

Conversation

@jd

@jd jd commented Dec 30, 2019

Copy link
Copy Markdown
Contributor

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

jd commented Jan 13, 2020

Copy link
Copy Markdown
Contributor Author

@vstinner just in case you missed it 👋 :)

Comment thread Python/errors.c Outdated
Comment thread Python/errors.c Outdated
Comment thread Misc/NEWS.d/next/C API/2019-12-30-10-43-52.bpo-39164.WEV0uu.rst Outdated
Comment thread Include/pyerrors.h Outdated
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 expose-PyErr_GetExcInfo branch from 76d6cbf to 1b19a83 Compare January 13, 2020 15:50
@jd
jd requested a review from vstinner January 13, 2020 16:24
@jd

jd commented Jan 13, 2020

Copy link
Copy Markdown
Contributor Author

Failure looks unrelated 🤔

@vstinner

Copy link
Copy Markdown
Member

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
@vstinner

Copy link
Copy Markdown
Member

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

@jd
jd deleted the expose-PyErr_GetExcInfo branch January 13, 2020 16:43
@jd

jd commented Jan 13, 2020

Copy link
Copy Markdown
Contributor Author

Thank you @vstinner 🙇

Comment thread Python/errors.c
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);

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.

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

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.

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

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants