mò
­fIc           @   sÆ  d  k  l Z l Z l Z d k l Z d k Z d k Z d k Z d k	 Z	 d GHy d k
 Z
 e e
 ƒ Wn e j
 o Z e e ‚ n Xd „  Z d „  Z e e ƒ d k Z y e i Z Wn e j
 o n Xe e ƒ d k Z e e d ƒ Z e i ƒ  e e d ƒ Z e i Z z0 y e e _ e ƒ  Z Wn e j
 o n XWd e e _ e i ƒ  Xe e ƒ y e d d ƒ Wn e j
 o n Xe e ƒ y d k Z Wn e j
 o n Xe e ƒ g  Z y e d	 Z Wn e j
 o n Xe e ƒ h  Z y e d
 Z Wn e j
 o n Xe e ƒ d GHe e  ƒ d GHe e! ƒ y
 e" Z Wn e! j
 o n Xe e# ƒ e i$ d d e% e& ƒ d Z x e' d ƒ D] Z( e e 7Z q›We e) ƒ d GHe e* ƒ y d d UWn e* j
 o n Xd „  Z+ d Z, e i- i. d ƒ o d GHd GHn e+ e, d ƒ d Z, e+ e, d ƒ e+ d d ƒ e e/ ƒ e e0 ƒ e e1 ƒ d GHe e2 ƒ d k Z y e i3 d ƒ Wn e2 j
 o n Xe e4 ƒ y g  f  Wn e4 j
 o n Xe e5 ƒ y e6 d ƒ Z Wn e5 j
 o n Xe e7 ƒ y d d Z Wn e7 j
 o n Xe e8 ƒ y d d Z Wn e8 j
 o	 Z n Xd f  d „  ƒ  YZ9 d  „  Z: d! „  Z; e i- i. d ƒ p e: ƒ  e; ƒ  n e e ƒ d" „  Z< e< ƒ  d S(#   (   s
   TestFaileds   TESTFNs   unlink(   s	   ClassTypeNs   5. Built-in exceptionsc         C   sn   y |  d ‚ Wn! |  j
 o } t | ƒ } n Xy |  d ƒ ‚ Wn! |  j
 o } t | ƒ } n X| GHd  S(   Nt   spam(   t   exct   errt   strt   buf(   R   R   R   (    (    t1   /mit/python/lib/python2.4/test/test_exceptions.pyt   test_raise_catch   s    c         C   s/   t  |  ƒ t |  t ƒ o |  i GHn |  GHd  S(   N(   R   t   thingt
   isinstancet	   ClassTypet   __name__(   R   (    (    R   t   r   s    
t   wR   s   this file does not existi
   t   keys   (not testable in a script)s   (not safe to test)t   errort    i   i€   s   (not used any more?)s   /
c         C   s_   y t  |  d d ƒ Wn? t j
 o3 } | i GH| i | j o	 d GHq[ d G| GHn Xd GHd  S(   Ns
   <fragment>t   exect   oks	   expected:s"   failed to get expected SyntaxError(   t   compilet   srct   SyntaxErrort   et   msg(   R   R   R   (    (    R   t   ckmsgm   s    	s=   while 1:
    try:
        pass
    finally:
        continue
t   javas0   'continue' not supported inside 'finally' clauseR   s#   try:
    continue
except:
    pass
s   'continue' not properly in loops	   continue
s   (hard to reproduce)i    i'  t   BadExceptionc           B   s   t  Z d „  Z RS(   Nc         C   s   t  d ‚ d  S(   Ns   can't instantiate BadException(   t   RuntimeError(   t   self(    (    R   t   __init__²   s    (   R
   t
   __module__R   (    (    (    R   R   ±   s   c          C   s›   d  k  } y | i t d ƒ Wnr t j
 of } t i ƒ  \ } } } | i	 i
 }  |  i d j p t ‚ |  i i d t i d ƒ p t ‚ n Xd GHd  S(   Ni   t
   test_capi1t   test_exceptionst   pys   Expected exception(   t	   _testcapit   raise_exceptionR   t	   TypeErrorR   t   syst   exc_infoR   t   tbt   tb_framet   f_codet   cot   co_namet   AssertionErrort   co_filenamet   endswitht   ost   extsep(   R)   R   R   R!   R&   (    (    R   R   µ   s    	*c          C   sÁ   d  k  } y | i t d ƒ Wn˜ t j
 oŒ } t i ƒ  \ } } } | i	 i
 } | i d j p t ‚ | i i d t i d ƒ p t ‚ | i	 i i
 }  |  i d j p t ‚ n Xd GHd  S(   Ni    R   R   R    t
   test_capi2s   Expected exception(   R!   R"   R   R   R   R$   R%   R   R&   R'   R(   R)   R*   R+   R,   R-   R.   R/   t   f_backt   co2(   R2   R)   R   R   R!   R&   (    (    R   R0   Á   s    	%c             s6   ‡  d †  ‰  y ˆ  ƒ  Wn t j
 o n Xd GHd  S(   Nc              s)   y ˆ  ƒ  SWn t j
 o d Sn Xd  S(   Niÿÿÿÿ(   t   gt
   ValueError(    (   R3   (    R   R3   Ö   s    s   Expected exception(   R3   R   (   R3   (    (   R3   R   t   test_infinite_recursionÕ   s    (=   t   test.test_supportt
   TestFailedt   TESTFNt   unlinkt   typesR	   t   warningsR$   t	   tracebackR.   t
   exceptionst   reloadt   ImportErrorR   R   R   t   AttributeErrort   undefined_attributet   xt   EOFErrort   opent   fpt   closet   stdint	   savestdint	   raw_inputt   IOErrort   undefined_modulet
   IndexErrort   at   KeyErrort   KeyboardInterruptt   MemoryErrort	   NameErrort   undefined_variablet   OverflowErrort   filterwarningst   OverflowWarningR
   t   ranget   dummyR   R   R   t   st   platformt
   startswitht   IndentationErrort   TabErrort   SystemErrort
   SystemExitt   exitR#   R4   t   chrt   ZeroDivisionErrort	   ExceptionR   R   R0   R5   (   RK   R.   R   R   R5   RH   R   R0   RX   R   RE   R;   R$   R7   R9   R8   RM   RW   R   R	   R<   R   R=   RB   (    (    R   t   ?   sø   				
	  
	
			 	
  
  
  
  


 
 
 

  		



	  
  
  
  
  		
	