/usr/lib/python3/dist-packages/pudb/b.py is in python3-pudb 2014.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import sys
from pudb import _get_debugger, set_interrupt_handler
def __myimport__(name, *args, **kwargs):
if name == 'pudb.b':
set_trace()
return __origimport__(name, *args, **kwargs)
# Will only be run on first import
__builtins__['__origimport__'] = __import__
__builtins__['__import__'] = __myimport__
def set_trace():
dbg = _get_debugger()
set_interrupt_handler()
dbg.set_trace(sys._getframe().f_back.f_back)
set_trace()
|