N
δωO5c       sC   d  Z  d d d  Z e e e d  Z e d j o e   n d S(   s$   Utilities dealing with code objects.c    s5  t  } } } t  } } } y t |  | |  } Wn t j
 o	 } n Xy t |  d | |  } Wn t j
 o	 } n Xy t |  d | |  } Wn t j
 o	 } n X| o | Sn y | i }	 Wn t j
 o | }	 n Xy | i }
 Wn t j
 o | }
 n X| o
 |	 |
 j o t |  n d S(   s  Compile a command and determine whether it is incomplete.

    Arguments:

    source -- the source string; may contain \n characters
    filename -- optional filename from which source was read; default "<input>"
    symbol -- optional grammar start symbol; "single" (default) or "eval"

    Return value / exception raised:

    - Return a code object if the command is complete and valid
    - Return None if the command is incomplete
    - Raise SyntaxError if the command is a syntax error

    Approach:
    
    Compile three times: as is, with \n, and with \n\n appended.  If
    it compiles as is, it's complete.  If it compiles with one \n
    appended, we expect more.  If it doesn't compile either way, we
    compare the error we get when compiling with \n or \n\n appended.
    If the errors are the same, the code is broken.  But if the errors
    are different, we expect more.  Not intuitive; not even guaranteed
    to hold in future releases; but this matches the compiler's
    behavior in Python 1.4 and 1.5.

    s   
s   

N(   s   Nones   errs   err1s   err2s   codes   code1s   code2s   compiles   sources   filenames   symbols   SyntaxErrors   __dict__s   e1s   AttributeErrors   e2(   s   sources   filenames   symbols   errs   err1s   err2s   codes   code1s   code2s   e1s   e2s.   /var/tmp/python-root/usr/lib/python1.5/code.pys   compile_command s6     s   <input>s   singlec    sμ  y
 k  } Wn n X| p h  } k } k } k } d | _ d | _ |  o	 |  GHn d G| i GH| i	 GHg  } xvd on| o | i } n
 | i } y | |  }	 Wn4 e j
 o d GHg  } qr n e j
 o Pn X| i |	  y e | i | d   }
 Wn) e j
 o | i d  g  } qr n X|
 e j o qr n y |
 | UWn | i | i | i f \ } } } e | i | i   } y d d Wn e | i | i   } n X| i | | | | |  n Xg  } qr Wd S(	   s/   Closely emulate the interactive Python console.s   >>> s   ... s   Python Interactive Consolei   s   
KeyboardInterrupts   
i    N(   s   readlines   locals   syss   strings	   tracebacks   ps1s   ps2s   banners   versions	   copyrights   bufs   prompts   readfuncs   lines   KeyboardInterrupts   EOFErrors   appends   compile_commands   joins   xs   SyntaxErrors	   print_excs   Nones   exc_types	   exc_values   exc_tracebacks   lens
   extract_tbs   ls   ms   print_exception(   s   banners   readfuncs   locals   readlines   syss   strings	   tracebacks   bufs   prompts   lines   xs   exc_types	   exc_values   exc_tracebacks   ls   ms.   /var/tmp/python-root/usr/lib/python1.5/code.pys   interact? s^      
 			  	     ! s   __main__N(   s   __doc__s   compile_commands   Nones	   raw_inputs   interacts   __name__(    s.   /var/tmp/python-root/usr/lib/python1.5/code.pys   ? s   <.