| Server IP : 35.80.110.71 / Your IP : 216.73.216.52 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/IPython/core/__pycache__/ |
Upload File : |
�
}�eؗ � �" � d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl
mZ ddl
mZm
Z
ddlmZ dZd Zdd
lmZ dZej, dk Zd
� Zdd�Zdd�Z ej6 d� Zd� Zdd�Z G d� de� Z G d� de� Zdd�Z y)a�
Pdb debugger class.
This is an extension to PDB which adds a number of new features.
Note that there is also the `IPython.terminal.debugger` class which provides UI
improvements.
We also strongly recommend to use this via the `ipdb` package, which provides
extra configuration options.
Among other things, this subclass of PDB:
- supports many IPython magics like pdef/psource
- hide frames in tracebacks based on `__tracebackhide__`
- allows to skip frames based on `__debuggerskip__`
The skipping and hiding frames are configurable via the `skip_predicates`
command.
By default, frames from readonly files will be hidden, frames containing
``__tracebackhide__=True`` will be hidden.
Frames containing ``__debuggerskip__`` will be stepped over, frames who's parent
frames value of ``__debuggerskip__`` is ``True`` will be skipped.
>>> def helpers_helper():
... pass
...
... def helper_1():
... print("don't step in me")
... helpers_helpers() # will be stepped over unless breakpoint set.
...
...
... def helper_2():
... print("in me neither")
...
One can define a decorator that wraps a function between the two helpers:
>>> def pdb_skipped_decorator(function):
...
...
... def wrapped_fn(*args, **kwargs):
... __debuggerskip__ = True
... helper_1()
... __debuggerskip__ = False
... result = function(*args, **kwargs)
... __debuggerskip__ = True
... helper_2()
... # setting __debuggerskip__ to False again is not necessary
... return result
...
... return wrapped_fn
When decorating a function, ipdb will directly step into ``bar()`` by
default:
>>> @foo_decorator
... def bar(x, y):
... return x * y
You can toggle the behavior with
ipdb> skip_predicates debuggerskip false
or configure it in your ``.pdbrc``
License
-------
Modified from the standard pdb.Pdb class to avoid including readline, so that
the command line completion of other programs which include this isn't
damaged.
In the future, this class will be expanded with improvements over the standard
pdb.
The original code in this file is mainly lifted out of cmd.py in Python 2.2,
with minor changes. Licensing should therefore be under the standard Python
terms. For details on the PSF (Python Software Foundation) standard license,
see:
https://docs.python.org/2/license.html
All the changes since then are under the same license as IPython.
� N)�get_ipython)�contextmanager)�
PyColorize)� coloransi� py3compat)�exception_colorsTzipdb> )�Pdb�__debuggerskip__)� �
c �0 � | dk\ rd| dz
z dz S | dk( ryy)z<generate the leading arrow in front of traceback or debugger� �-�> � �>� � )�pads �7/usr/lib/python3/dist-packages/IPython/core/debugger.py�
make_arrowr � s) � �
�a�x��C��E�{�T�!�!� ����
� c � � t d� �)z�Exception hook which handles `BdbQuit` exceptions.
All other exceptions are processed using the `excepthook`
parameter.
z4`BdbQuit_excepthook` is deprecated since version 5.1)�
ValueError)�et�ev�tb�
excepthooks r �BdbQuit_excepthookr � s � � �>�� r c �&