[issue34756] Few changes in sys.breakpointhook()

Serhiy Storchaka report at bugs.python.org
Thu Sep 20 13:33:39 EDT 2018


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

The proposed PR makes the following changes in sys.breakpointhook():

* Use _PyObject_GetBuiltin() for getting a builtin. This simplifies the code.

* The only effect of using the "from" list is when the imported name is a submodule. But it should be a callable. Callable module is very rare bird, I don't think we need to support such weird case. Removing the "from" list simplifies the code.

* Only ImportError and AttributeError raised from import are ignored. Other errors are exposed to the user as is. This is most likely a KeyboardInterrupt or MemoryError. They shouldn't be silenced.

sys.breakpointhook() was added in issue31353.

----------
components: Interpreter Core
messages: 325914
nosy: barry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Few changes in sys.breakpointhook()
type: enhancement
versions: Python 3.8

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


More information about the Python-bugs-list mailing list