Mini Shell

Direktori : /usr/lib/python3.6/site-packages/meh/__pycache__/
Upload File :
Current File : //usr/lib/python3.6/site-packages/meh/__pycache__/safe_string.cpython-36.pyc

3

��\�	�@s0ddlZeejjd�d�ZGdd�de�ZdS)�N�.c@seZdZdZdd�ZdS)�SafeStrz�
    String class that has a modified __add__ method so that ascii strings,
    binary data represented as a byte string and unicode objects can be
    safely appended to it (not causing traceback). BINARY DATA IS OMITTED.

    cCs�tdkrttj|t|���St|t�p.t|t�sHt|d�rD|j�}nd}t|t�rjttj||jd���}njy|j	d�ttj||��}WnJt
k
r�dd�|D�}dd�|D�}dj|�}ttj||��}YnX|S)	N��__str__z%OMITTED OBJECT WITHOUT __str__ METHODzutf-8css|]}tt|��VqdS)N)�hex�ord)�.0�char�r
�!/usr/lib/python3.6/safe_string.py�	<genexpr>@sz"SafeStr.__add__.<locals>.<genexpr>css|]}|jdd�VqdS)Z0xz\xN)�replace)rZhex_numr
r
rrAs�)�PYr�str�__add__�
isinstanceZunicode�hasattrr�encode�decode�UnicodeDecodeError�join)�self�other�retZ
other_hexaZother_backslashedZ
other_reprr
r
rr(s$




zSafeStr.__add__N)�__name__�
__module__�__qualname__�__doc__rr
r
r
rr sr)�sys�int�version�splitrrrr
r
r
r�<module>s