Created originally on Bitbucket by Yannick_Jadoul (Yannick Jadoul)
Was already merged in Bitbucket before import, marked as merged by the import user
Source changeset not longer availableat the time of import. Commit listwill look empty
Cfr. https://www.python.org/dev/peps/pep-0553/ and https://github.com/python/cpython/pull/3355/
Replaced the proposed (https://www.python.org/dev/peps/pep-0553/#implementation)
def breakpoint(*args, **kws):
import sys
missing = object()
hook = getattr(sys, 'breakpointhook', missing)
if hook is missing:
raise RuntimeError('lost sys.breakpointhook')
return hook(*args, **kws)
by simpler
import sys
def breakpoint(*args, **kwargs):
if not hasattr(sys, 'breakpointhook'):
raise RuntimeError('lost sys.breakpointhook')
return sys.breakpointhook(*args, **kwargs)
Tests are still missing, as they are not immediately straightforward to implement.