Your IP : 52.14.75.147


Current Path : /opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/fix_except.cpython-33.pyo

�
��f
c@s�dZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZmZdd�Z
Gdd	�d	ej�Zd
S(u�Fixer for except statements with named exceptions.

The following cases will be converted:

- "except E, T:" where T is a name:

    except E as T:

- "except E, T:" where T is not a name, tuple or list:

        except E as t:
            T = t

    This is done because the target of an "except" clause must be a
    name.

- "except E, T:" where T is a tuple or list literal:

        except E as t:
            T = t.args
i(upytree(utoken(u
fixer_base(uAssignuAttruNameuis_tupleuis_listusymsccsbx[t|�D]M\}}|jtjkr
|jdjdkrZ|||dfVqZq
q
WdS(Niuexcepti(u	enumerateutypeusymsu
except_clauseuchildrenuvalue(unodesuiun((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_except.pyufind_exceptssufind_exceptscBs,|EeZdZdZdZdd�ZdS(u	FixExceptu1
    try_stmt< 'try' ':' (simple_stmt | suite)
                  cleanup=(except_clause ':' (simple_stmt | suite))+
                  tail=(['except' ':' (simple_stmt | suite)]
                        ['else' ':' (simple_stmt | suite)]
                        ['finally' ':' (simple_stmt | suite)]) >
    cCs|j}dd�|dD�}dd�|dD�}x�t|�D]�\}}t|j�dkrD|jdd�\}}	}
|	jtdd	d
��|
jtjkr�t|j	�d	d
�}|
j
�}d|_|
j|�|j
�}|j}
x0t|
�D]"\}}t
|tj�rPqqWt|
�sFt|
�rgt|t|td���}nt||�}x.t|
d|��D]}|jd
|�q�W|j||�q�|
jdkr�d
|
_q�qDqDWdd�|jdd�D�||}tj|j|�S(NcSsg|]}|j��qS((uclone(u.0un((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_except.pyu
<listcomp>2s	u'FixExcept.transform.<locals>.<listcomp>utailcSsg|]}|j��qS((uclone(u.0uch((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_except.pyu
<listcomp>4s	ucleanupiiuasuprefixu uuargsicSsg|]}|j��qS((uclone(u.0uc((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_except.pyu
<listcomp>\s	i(usymsufind_exceptsulenuchildrenureplaceuNameutypeutokenuNAMEunew_nameucloneuprefixu	enumerateu
isinstanceupytreeuNodeuis_tupleuis_listuAssignuAttrureverseduinsert_child(uselfunodeuresultsusymsutailutry_cleanupu
except_clauseue_suiteuEucommauNunew_Nutargetusuite_stmtsuiustmtuassignuchilduchildren((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_except.pyu	transform/s6		
	!(uFixExcept.transformNT(u__name__u
__module__u__qualname__uTrueu
BM_compatibleuPATTERNu	transform(u
__locals__((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_except.pyu	FixExcept$su	FixExceptN(u__doc__uupytreeupgen2utokenu
fixer_baseu
fixer_utiluAssignuAttruNameuis_tupleuis_listusymsufind_exceptsuBaseFixu	FixExcept(((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_except.pyu<module>s.

?>