Your IP : 216.73.216.85
��Yf� � @ s� d Z d d l m Z d Z d d l m Z d d l Z d d l Z d d l Z d d l m Z d d l m
Z
d d
l
m Z e j � d d � Z
d
d � Z e d k r� e
� d S)z,Main program for testing the infrastructure.� )�print_functionz#Guido van Rossum <guido@python.org>� )�supportN� )�pytree)�pgen2)�driverc
C s� t j d � } t j | d t j �} d } | j | d d �} t | | � s[ t d � t j d d � sr d Sg } x� t j
D]� } t j
| } | d k s� t | d � r� q� | j } | j
d � r� | d d � } | j
d
� s� q� t d | d t j �| j | d d �} t | | � r� | j | � q� Wxt j D]} y t j | � } Wn t k
rswCYn Xt d
| d d t j �x� | D]� } | j
d
� s�q�t d | d t j �t j j | | � } y | j | d d �} Wn8 t j j k
r*} z t d | � WYd d } ~ Xq�Xt | | � r�| j | � q�WqCW| sbt d � n( t d � x | D] } t d | � qsWd S)NzGrammar.txt�convertz
example.py�debugTz No diffs.r �__file__z.pycz.pyZParsing�fileZScanningz...zParseError:zNo problems. Congratulations!zProblems in following files:z***���)r Zload_grammarZDriverr r Z
parse_file�diff�print�sys�argv�modules�hasattrr �endswith�stderr�append�path�os�listdir�OSError�joinr �parseZ
ParseError)
ZgrZdr�fn�treeZproblems�name�mod�dir�names�err� r$ �E/opt/alt/python35/lib64/python3.5/lib2to3/tests/pytree_idempotency.py�main sX
r&