[issue46531] Simplify exception handling in `doctest.py`

Nikita Sobolev report at bugs.python.org
Wed Jan 26 04:42:50 EST 2022


New submission from Nikita Sobolev <mail at sobolevn.me>:

Right now there are two places where `sys.exc_info()` calls are not required anymore:
1. https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L1352-L1353
2. https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L2640-L2641

There are also places where it is exposed as a part of public API (I am not going to change that, at least in this PR):
- https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L1757
- https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L1262

And some private APIs (out of scope as well):
- https://github.com/python/cpython/blob/6e5a193816e1bdf11f5fb78d620995fd6987ccf8/Lib/doctest.py#L244

PR is on its way!

----------
components: Library (Lib)
messages: 411720
nosy: iritkatriel, sobolevn
priority: normal
severity: normal
status: open
title: Simplify exception handling in `doctest.py`
type: behavior
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46531>
_______________________________________


More information about the Python-bugs-list mailing list