Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/IPython/core/__pycache__/debugger.cpython-39.pyc
Ðазад
a o�hؗ � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl mZ ddl mZm Z ddlmZ dZd Zdd lmZ dZejdk Zd d� Zddd�Zd dd�Ze�d�Zdd� Zd!dd�ZG dd� de�ZG dd� de�Zd"dd�Z dS )#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> )�PdbZ__debuggerskip__)� � c C s( | dkrd| d d S | dkr$dS dS )z<generate the leading arrow in front of traceback or debugger� �-�> � �>� � )�padr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/IPython/core/debugger.py� make_arrow� s r c C s t d��dS )z�Exception hook which handles `BdbQuit` exceptions. All other exceptions are processed using the `excepthook` parameter. z4`BdbQuit_excepthook` is deprecated since version 5.1N)� ValueError)�et�ev�tb� excepthookr r r �BdbQuit_excepthook� s �r c C s t dtdd��d S )Nz<`BdbQuit_IPython_excepthook` is deprecated since version 5.1r )� stacklevel)r �DeprecationWarning)�selfr r r � tb_offsetr r r �BdbQuit_IPython_excepthook� s �r z (?<=\n)\s+c C s t �d| �S )Nr )�RGX_EXTRA_INDENT�sub)Zmultiline_stringr r r �strip_indentation� s r"