New submission from Serhiy Storchaka <storchaka+cpyt...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue34756>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to