mirror of
https://github.com/python/cpython.git
synced 2026-05-04 09:31:02 +00:00
Merge c98f0ffbdc into 68fe899feb
This commit is contained in:
commit
c4191da3d9
4 changed files with 19 additions and 1 deletions
|
|
@ -789,6 +789,14 @@ base64
|
|||
(Contributed by Gregory P. Smith in :gh:`146311`.)
|
||||
|
||||
|
||||
bdb
|
||||
---
|
||||
* :exc:`bdb.BdbQuit` is now a subclass of :exc:`BaseException`, instead of
|
||||
:exc:`Exception`, to allow it to be used for cleanly exiting the debugger without
|
||||
being accidentally caught by user code.
|
||||
(Contributed by Tian Gao in :gh:`149337`.)
|
||||
|
||||
|
||||
binascii
|
||||
--------
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
GENERATOR_AND_COROUTINE_FLAGS = CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR
|
||||
|
||||
|
||||
class BdbQuit(Exception):
|
||||
class BdbQuit(BaseException):
|
||||
"""Exception to give up completely."""
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1237,6 +1237,15 @@ def test_format_stack_entry_no_lineno(self):
|
|||
self.assertIn('Warning: lineno is None',
|
||||
Bdb().format_stack_entry((sys._getframe(), None)))
|
||||
|
||||
def test_bdb_quit_base_exception(self):
|
||||
# gh-149309
|
||||
try:
|
||||
raise _bdb.BdbQuit()
|
||||
except Exception:
|
||||
self.fail(f'BdbQuit should not be caught by Exception')
|
||||
except BaseException:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
:exc:`bdb.BdbQuit` is now a subclass of :exc:`BaseException`, instead of :exc:`Exception`, to allow it to be used for cleanly exiting the debugger without being accidentally caught by user code.
|
||||
Loading…
Add table
Add a link
Reference in a new issue