shell bypass 403
o
`bȬ � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddlmZm
Z
ddlmZ ddlmZ G dd� de�ZG d d
� d
e�ZG dd� de�ZG d
d� de�ZdZdd� Zdd� ZG dd� dej�ZG dd� de�ZG dd� d�Zd5dd�Ze
dd� �Zeddfdd�Zd Z e d! Z!d"d#� Z"d$d%� Z#d&d'� Z$d(d)� Z%G d*d+� d+ej&�Z'G d,d-� d-e'�Z(G d.d/� d/e'�Z)G d0d1� d1e'�Z*G d2d3� d3e'�Z+e,d4kr�e�-� dS dS )6a� Test the bdb module.
A test defines a list of tuples that may be seen as paired tuples, each
pair being defined by 'expect_tuple, set_tuple' as follows:
([event, [lineno[, co_name[, eargs]]]]), (set_type, [sargs])
* 'expect_tuple' describes the expected current state of the Bdb instance.
It may be the empty tuple and no check is done in that case.
* 'set_tuple' defines the set_*() method to be invoked when the Bdb
instance reaches this state.
Example of an 'expect_tuple, set_tuple' pair:
('line', 2, 'tfunc_main'), ('step', )
Definitions of the members of the 'expect_tuple':
event:
Name of the trace event. The set methods that do not give back
control to the tracer [1] do not trigger a tracer event and in
that case the next 'event' may be 'None' by convention, its value
is not checked.
[1] Methods that trigger a trace event are set_step(), set_next(),
set_return(), set_until() and set_continue().
lineno:
Line number. Line numbers are relative to the start of the
function when tracing a function in the test_bdb module (i.e. this
module).
co_name:
Name of the function being currently traced.
eargs:
A tuple:
* On an 'exception' event the tuple holds a class object, the
current exception must be an instance of this class.
* On a 'line' event, the tuple holds a dictionary and a list. The
dictionary maps each breakpoint number that has been hit on this
line to its hits count. The list holds the list of breakpoint
number temporaries that are being deleted.
Definitions of the members of the 'set_tuple':
set_type:
The type of the set method to be invoked. This may
be the type of one of the Bdb set methods: 'step', 'next',
'until', 'return', 'continue', 'break', 'quit', or the type of one
of the set methods added by test_bdb.Bdb: 'ignore', 'enable',
'disable', 'clear', 'up', 'down'.
sargs:
The arguments of the set method if any, packed in a tuple.
� N)�contextmanager)�islice�repeat)�
import_helper)� os_helperc @ s e Zd ZdS )�BdbExceptionN)�__name__�
__module__�__qualname__� r r �6/usr/local/python-3.10/lib/python3.10/test/test_bdb.pyr @ s r c @ � e Zd ZdZdS )�BdbErrorz!Error raised by the Bdb instance.N�r r r
�__doc__r r r r r A � r c @ r
)�BdbSyntaxErrorzSyntax error in the test case.Nr r r r r r B r r c @ r
)�BdbNotExpectedErrorzUnexpected result.Nr r r r r r C r r c C s t j�� d S �N)�_bdb�
BreakpointZclearBreakpointsr r r r �reset_BreakpointK s r c C s� dd� t jjD �} | s
dS d}| D ];}|sd}d}|jrdnd}|jr%d nd
}|d|j|||j|jtj �
|j�|jf 7 }|j
rH|d|j
f 7 }|d
7 }q|S )Nc S s g | ]}|r|�qS r r )�.0�bpr r r �
<listcomp>O � z$info_breakpoints.<locals>.<listcomp>� Fz!BpNum Temp Enb Hits Ignore Where
Tzyes zno Zyeszno z%-5d %s %s %-4d %-6d at %s:%dz
stop only if %s�
)r r Z
bpbynumber� temporary�enabledZnumber�hits�ignore�os�path�basename�file�line�cond)�bp_listZheader_addedr �infoZdispZenabr r r �info_breakpointsN s&