Viewing File: /opt/alt/python-internal/lib64/python3.11/unittest/__pycache__/util.cpython-311.pyc
!A?h_ d Z ddlmZmZ ddlmZ dZdZdZdZ dZ
dZee ez ez ez e
z z
Zedk sJ d Z
d ZddZd Zd
Zd Zd Z edd Zd Zd ZdS )zVarious utility functions. )
namedtupleCounter)commonprefixTP c t | |z
|z
}|t k r(d| d | || t | |z
d fz } | S )Nz%s[%d chars]%s)len_PLACEHOLDER_LEN)s prefixlen suffixlenskips :/opt/alt/python-internal/lib64/python3.11/unittest/util.py_shortenr sW q66I )D*9*
tQs1vv 7I7J7J5KLLH c V t t t | } t t t | }|t
k r| S t
| t t
|z
t z t z z
}|t k rZt t z t z |z
z t
k sJ t t | t fd| D S t t t t fd| D S )Nc 3 2 K | ]}|d z V d S N .0r prefixr
s r <genexpr>z'_common_shorten_repr.<locals>.<genexpr>' s0 ::Va
m+::::::r c 3 d K | ]*}t |d t t z V +d S r )r
_MIN_DIFF_LEN_MIN_END_LENr s r r z'_common_shorten_repr.<locals>.<genexpr>* sP (1YZZ=-NNN r )tuplemap safe_reprmaxr
_MAX_LENGTHr _MIN_BEGIN_LENr _MIN_COMMON_LENr )argsmaxlen
common_lenr r
s @@r _common_shorten_reprr( s8 Y%%&&D
S$
F
$
FFI9$~58HHJJO## 00?B"$&12 2 2 2&.*==:::::T::::::
fno
>
>F r Fc t | }n*# t $ r t | }Y nw xY w|rt | t
k r|S |d t
dz S )Nz [truncated]...)repr Exceptionobject__repr__r
r"