ó
ŠwÛjc           @   sû   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l m Z m Z m Z m	 Z	 m
 Z
 m Z d  d l m Z d e f d „  ƒ  YZ d e j f d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 e j f d „  ƒ  YZ d „  Z e d k r÷ e ƒ  n  d S(   iÿÿÿÿN(   t   TESTFNt   unlinkt   run_unittestt   captured_stderrt   check_warningst   cpython_only(   t   ignore_deprecation_warningst   BrokenStrExceptionc           B   s   e  Z d  „  Z e Z RS(   c         C   s   t  d ƒ ‚ d  S(   Ns   str() is broken(   t	   Exception(   t   self(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   __str__   s    (   t   __name__t
   __module__R
   t   __repr__(    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR      s   	t   ExceptionTestsc           B   sÔ   e  Z d  „  Z d „  Z d „  Z d „  Z e d „  ƒ Z d „  Z e	 d „  ƒ Z
 d „  Z d „  Z e	 d	 „  ƒ Z e	 d
 „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   sU   y* d d l  m } d d  l } | | ƒ Wn$ t k
 rP } |  j d | ƒ n Xd  S(   Niÿÿÿÿ(   t   reloads   reloading exceptions: %s(   t   impR   t
   exceptionst   ImportErrort   fail(   R	   R   R   t   e(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt
   testReload   s    c         C   sˆ   y | d ‚ Wn | k
 r. } t  | ƒ } n Xy | d ƒ ‚ Wn | k
 r` } t  | ƒ } n X|  j | | ƒ |  j | j | ƒ d  S(   Nt   spam(   t   strt   assertEqualR   (   R	   t   exct   excnamet   errt   buf1t   buf2(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   raise_catch   s    c         B   s/  |  j  e d ƒ |  j e e e d ƒ |  j  e d ƒ e e d ƒ } | j ƒ  e e d ƒ } e j	 } z. y | e _	 e
 ƒ  } Wn e k
 r“ n XWd  | e _	 | j ƒ  e e ƒ X|  j  e d ƒ |  j e e d d ƒ |  j  e d ƒ |  j e e d	 ƒ |  j  e d
 ƒ g  } |  j e | j d ƒ |  j  e d ƒ i  } |  j e | j d ƒ |  j  e d ƒ |  j  e d ƒ |  j  e d ƒ y
 e } Wn e k
 r¤n X|  j  e d ƒ d } x e d ƒ D] } | | 7} qÈW|  j  e d ƒ |  j  e d ƒ y d d  UWn e k
 rn X|  j  e d ƒ |  j  e d ƒ |  j  e d ƒ |  j  e d ƒ |  j e e j d ƒ |  j  e d ƒ y g  d! Wn e k
 r¡n X|  j  e  d ƒ |  j e  e! d ƒ |  j  e" d ƒ y d d } Wn e" k
 rön X|  j  e# d  ƒ y d d } Wn e# k
 r*} n Xd  S("   Nt   AttributeErrort   undefined_attributet   EOFErrort   wt   rt   IOErrors   this file does not existR   t   undefined_modulet
   IndexErrori
   t   KeyErrort   keyt   KeyboardInterruptt   MemoryErrort	   NameErrort   OverflowErrori   i€   t   RuntimeErrort   SyntaxErrors   /
t   IndentationErrort   TabErrort   SystemErrort
   SystemExiti    t	   TypeErrort
   ValueErrori'  t   ZeroDivisionErrorR   (    ($   R   R   t   assertRaisest   getattrt   sysR!   t   openR    t   closet   stdint	   raw_inputR   R$   R   t
   __import__R&   t   __getitem__R'   R)   R*   R+   t   undefined_variableR,   t   rangeR-   R.   R/   R0   R1   R2   t   exitR3   R4   t   chrR5   R   (   R	   t   fpt	   savestdint   xt   dummyR   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testRaising+   s‚    
			
 
         c            s[   ‡  f d †  } d } t  j j d ƒ s7 | | d ƒ n  d } | | d ƒ | d d ƒ d  S(   Nc            sg   y t  |  d d ƒ Wn? t k
 rU } | j | k rc ˆ  j d | | j f ƒ qc n Xˆ  j d ƒ d  S(   Ns
   <fragment>t   execs   expected %s, got %ss"   failed to get expected SyntaxError(   t   compileR.   t   msgR   (   t   srcRJ   R   (   R	   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   ckmsg€   s    !s\   while 1:
            try:
                pass
            finally:
                continuet   javas0   'continue' not supported inside 'finally' clausesH   if 1:
        try:
            continue
        except:
            passs   'continue' not properly in loops	   continue
(   R8   t   platformt
   startswith(   R	   RL   t   s(    (   R	   sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testSyntaxErrorMessage|   s    c            s^   d d d „  ƒ  Y‰  ‡  ‡ f d †  } ‡  ‡ f d †  } t  j j d ƒ sZ | ƒ  | ƒ  n  d  S(   Nt   BadExceptionc           B   s   e  Z d  „  Z RS(   c         S   s   t  d ‚ d  S(   Ns   can't instantiate BadException(   R-   (   t   self_(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   __init__¡   s    (   R   R   RT   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRR       s   c             sŸ   d d  l  }  y |  j ˆ  d ƒ Wnk t k
 r� } t j ƒ  \ } } } | j j } ˆ j | j d ƒ ˆ j	 | j
 j d t j d ƒ ƒ n Xˆ j d ƒ d  S(   Niÿÿÿÿi   t
   test_capi1t   test_exceptionst   pys   Expected exception(   t	   _testcapit   raise_exceptionR3   R8   t   exc_infot   tb_framet   f_codeR   t   co_namet
   assertTruet   co_filenamet   endswitht   ost   extsepR   (   RX   R   R   t   tbt   co(   RR   R	   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRU   ¤   s    (c             sÁ   d d  l  }  y |  j ˆ  d ƒ Wn� t k
 r¯ } t j ƒ  \ } } } | j j } ˆ j | j d ƒ ˆ j	 | j
 j d t j d ƒ ƒ | j j j } ˆ j | j d ƒ n Xˆ j d ƒ d  S(   Niÿÿÿÿi    RT   RV   RW   t
   test_capi2s   Expected exception(   RX   RY   R-   R8   RZ   R[   R\   R   R]   R^   R_   R`   Ra   Rb   t   f_backR   (   RX   R   R   Rc   Rd   t   co2(   RR   R	   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRe   °   s    $RM   (    (   R8   RN   RO   (   R	   RU   Re   (    (   RR   R	   sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testSettingException›   s    c         C   s“   y t  Wn t k
 r nt X|  j t t  d ƒ ƒ d ƒ |  j t t  d d ƒ ƒ d ƒ |  j t  d d ƒ j d ƒ |  j t  d d ƒ j d ƒ d  S(   Nié  t   1001t   messages   [Error 1001] messagei   (   t   WindowsErrorR+   R   R   t   errnot   winerror(   R	   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_WindowsErrorÂ   s    c         C   s.  t  d+ i d d 6d, d 6f t  d- i d d 6d. d 6f t  d/ i d d 6d0 d 6f t  d1 i d d 6d2 d 6f t d3 i d d 6d4 d 6d d 6f t d5 i d d 6d6 d 6d  d 6d  d 6d  d	 6f t d7 i d d 6d8 d 6d  d 6d d 6d
 d	 6f t d9 i d d 6d: d 6d d 6d d 6d
 d	 6f t d; i d d 6d< d 6f t d= i d d 6d> d 6d d	 6d d 6d d 6f t d? i d d 6d@ d 6d d 6d d	 6d d 6f t dA i d d 6d  d 6d  d 6d  d 6d  d 6d  d 6d  d 6f t dB i d d 6dC d 6d  d 6d  d 6d d 6d  d 6d  d 6d  d 6f t d dD f i d d 6d d 6d d 6d dE f d 6d  d 6d d 6d d 6d d 6f t dF i d d 6d  d 6dG d 6d  d 6d d 6d  d 6d  d 6d  d 6f t dH i d d 6dI d 6f t dJ i d d 6dK d 6d d 6d d 6d d  6d d! 6f t dL i d d 6dM d 6d d 6d" d 6d d  6d d! 6f t	 dN i d d 6dO d 6d# d 6d$ d! 6d d  6d d% 6f g } yD | j
 t dP i d d 6dQ d 6d d	 6d d& 6d' d 6d d 6f ƒ Wn t k
 r¼n Xxj| D]b\ } } } y | | Œ  ‚ WqÄt  k
 r%} t | ƒ | k	 r‚  n  |  j t | ƒ j d( ƒ t | ƒ } xJ | D]B } |  j t t | | ƒ ƒ t | | ƒ d) t | ƒ | f ƒ q9Wx¤ t t f D]’ } x‰ t | j d ƒ D]t }	 | j | j | |	 ƒ ƒ }
 xP | D]H } t t |
 | ƒ ƒ } t | | ƒ } |  j | | d* | | f ƒ qÎWq¦WqŒWqÄXqÄWd  S(R   Nt    Rj   t   argsi   t   foot   codet   filenameRl   t   strerrort   bart   bazt   quuxt   errnoStrt   strErrorStrt   filenameStrRJ   t   textt   linenot   offsett   print_file_and_linet   msgStrt	   linenoStrt	   offsetStrt   textStrt   print_file_and_lineStrt   asciiu   ai    s   ordinal not in ranget   encodingt   objectt   startt   reasons   ÿu   ã�‚t   oucht   endRm   i   R   s   exception "%s", attribute "%s"s   pickled "%r", attribute "%s"(    (    (   i   (   i   (   Rq   (   Rq   (   Rq   i   (   Rq   i   (   Rq   (   Rq   (   Rq   (   Rq   (   Rq   Ru   (   Rq   Ru   (   Rq   Ru   Rv   (   Rq   Ru   (   Rq   Ru   Rv   Rw   (   Rq   Ru   Rv   Rw   (   Rx   Ry   Rz   (   Rx   Ry   (   i   Ry   Rz   (   i   Ry   (    (   R   (   R   (   Rz   R€   R�   R‚   (   Rz   R€   R�   R‚   (   R   Rz   R€   R�   R‚   Rƒ   (   R   Rz   R€   R�   R‚   Rƒ   (    (    (   R„   u   ai    i   s   ordinal not in range(   R„   u   ai    i   s   ordinal not in range(   R„   s   ÿi    i   s   ordinal not in range(   R„   s   ÿi    i   s   ordinal not in range(   u   ã�‚i    i   R‰   (   u   ã�‚i    i   R‰   (   i   Ry   Rz   (   i   Ry   (   t   BaseExceptionR2   R$   t   Nonet   EnvironmentErrorR.   t   UnicodeErrort   UnicodeEncodeErrort   UnicodeDecodeErrort   UnicodeTranslateErrort   appendRk   R+   t   typeR   R   R   t   reprR7   t   picklet   cPickleR@   t   HIGHEST_PROTOCOLt   loadst   dumps(   R	   t   exceptionListR   Rp   t   expectedR   RP   t   checkArgNamet   pt   protocolt   newt   gott   want(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testAttributesÏ   s¸    


 

c         C   sW   t  d ƒ } t d t f ƒ � } |  j | j d ƒ Wd  QX|  j t | j ƒ d ƒ d  S(   NRq   s:   BaseException.message has been deprecated as of Python 2.6i   (   R‹   R   t   DeprecationWarningR   Rj   t   lent   warnings(   R	   R   R"   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testDeprecatedMessageAttribute9  s
    c         C   s€   t  d ƒ } d | _ t d t ƒ � } |  j | j d ƒ Wd  QX|  j t | j ƒ d ƒ | ` |  j t ƒ � | j Wd  QXd  S(   NRq   Ru   t   quieti    (	   R‹   Rj   R   t   TrueR   R¤   R¥   R6   R   (   R	   R   R"   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testRegularMessageAttributeB  s    	c         C   s’   t  d ƒ } t  d ƒ } d | _ xj t t f D]\ } | j | j | ƒ ƒ } |  j | j d ƒ | j | j | ƒ ƒ } |  j | j d ƒ q. Wd  S(   NRq   Ru   (   R   Rj   R•   R–   R˜   R™   R   (   R	   R   t   fR�   t   epRC   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testPickleMessageAttributeO  s    	c         C   s;   d } t  | Œ  } |  j | | ƒ |  j | j | ƒ d  S(   Ni   i   i   (   i   i   i   (   R‹   R   Rp   (   R	   Rp   R   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testSlicing[  s    c         C   sR   |  j  t t d d ƒd t f d „  ƒ  Y} | d d ƒ } |  j | j d ƒ d  S(   Nt   ai   t   DerivedExceptionc           B   s   e  Z d  „  Z RS(   c         S   s   t  j |  ƒ | |  _ d  S(   N(   R‹   RT   t	   fancy_arg(   R	   R°   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRT   j  s    (   R   R   RT   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR¯   i  s   R°   i*   (   R6   R3   R‹   R   R°   (   R	   R¯   RE   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testKeywordArgsd  s    c      	      s�   ‡  f d †  ‰  |  j  t ˆ  ƒ ‡ f d †  ‰ t ƒ  �D y ˆ ƒ  Wn$ t k
 rV n! |  j d ƒ n X|  j d ƒ Wd  QXd  S(   Nc              s   ˆ  ƒ  S(   N(    (    (   Rª   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRª   r  s    c              s$   y ˆ  ƒ  SWn t  k
 r d SXd  S(   Niÿÿÿÿ(   R4   (    (   t   g(    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR²   v  s    s   Should have raised KeyError(   R6   R-   R   R   (   R	   (    (   Rª   R²   sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testInfiniteRecursionq  s    	
c         C   su   |  j  t t ƒ ƒ |  j  t t ƒ ƒ |  j  t t d ƒ ƒ ƒ |  j  t t d ƒ ƒ ƒ |  j  t t d ƒ ƒ ƒ d  S(   NR®   u   au   Ã¡(   R^   R   R   t   unicode(   R	   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testUnicodeStrUsage‰  s
    c         C   sû  t  d d d d d ƒ } |  j t | ƒ d ƒ d | _ |  j t | ƒ d ƒ d | _ d	 | _ |  j t | ƒ d
 ƒ d | _ |  j t | ƒ d ƒ d | _ |  j t | ƒ d ƒ t d d d d d ƒ } |  j t | ƒ d ƒ d | _ |  j t | ƒ d ƒ d | _ d	 | _ |  j t | ƒ d ƒ d | _ |  j t | ƒ d ƒ d | _ |  j t | ƒ d ƒ t d d d d ƒ } |  j t | ƒ d ƒ d | _ |  j t | ƒ d ƒ d | _ d	 | _ |  j t | ƒ d ƒ d | _ |  j t | ƒ d ƒ d  S(   NRv   u   xxxxxi   i   Rq   s8   'baz' codec can't encode characters in position 1-4: fooi   s=   'baz' codec can't encode character u'\x78' in position 1: fool   ESh
MQ)EsJ   'baz' codec can't encode characters in position 1-4: 965230951443685724997i   sK   '4000' codec can't encode characters in position 1-4: 965230951443685724997iè  sN   '4000' codec can't encode characters in position 1000-4: 965230951443685724997t   xxxxxs3   'baz' codec can't decode bytes in position 1-4: foos5   'baz' codec can't decode byte 0x78 in position 1: foosE   'baz' codec can't decode bytes in position 1-4: 965230951443685724997sF   '4000' codec can't decode bytes in position 1-4: 965230951443685724997sI   '4000' codec can't decode bytes in position 1000-4: 965230951443685724997u   xxxxs/   can't translate characters in position 1-4: foos4   can't translate character u'\x78' in position 1: foosA   can't translate characters in position 1-4: 965230951443685724997sD   can't translate characters in position 1000-4: 965230951443685724997(	   R�   R   R   RŠ   Rˆ   R…   R‡   R�   R‘   (   R	   t   u(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   testUnicodeChangeAttributes’  s>    														c         C   sC   t  t t f } x- | D]% } |  j t | j | ƒ ƒ d ƒ q Wd  S(   NRo   (   R�   R�   R‘   R   R   t   __new__(   R	   t   klassest   klass(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_unicode_errors_no_object·  s    c      	      s  d t  f d „  ƒ  Y‰  d t f ‡  f d †  ƒ  Y} t ƒ  �g } y t ƒ  ‚ WnC | k
 rm } |  j d ƒ n1 t k
 r} n! |  j d ƒ n X|  j d ƒ Wd  QXt ƒ  �T } ‡ f d †  ‰ ˆ ƒ  \ } } } |  j | t k | ƒ |  j d t | ƒ ƒ Wd  QXd  S(	   Nt   Metac           B   s   e  Z d  „  Z RS(   c         S   s   t  ƒ  ‚ d  S(   N(   R4   (   t   clst   subclass(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   __subclasscheck__Á  s    (   R   R   RÀ   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR½   À  s   t   MyExceptionc              s   e  Z ˆ  Z RS(    (   R   R   t   __metaclass__(    (   R½   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRÁ   Ä  s   s%   exception should not be a MyExceptions   Should have raised KeyErrorc              s*   y ˆ  ƒ  SWn t  k
 r% t j ƒ  SXd  S(   N(   R-   R8   RZ   (    (   R²   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR²   Õ  s    s    maximum recursion depth exceeded(	   R“   R   R   R'   R   R^   R-   t   assertInR   (   R	   RÁ   t   stderrR   t   vRc   (    (   R½   R²   sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_badisinstance½  s"    c         C   s6   d t  f d „  ƒ  Y} |  j t ƒ � | ‚ Wd  QXd  S(   NRÁ   c           B   s   e  Z d  „  Z RS(   c         W   s   t  ƒ  S(   N(   R†   (   R¾   Rp   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR¹   á  s    (   R   R   R¹   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRÁ   à  s   (   R   R6   R3   (   R	   RÁ   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt!   test_new_returns_invalid_instanceÞ  s    c         C   sF   y t  s t d ƒ ‚ Wn) t k
 rA } |  j t | ƒ d ƒ n Xd  S(   Ni   s   (3,)(   i   (   t   Falset   AssertionErrorR   R   (   R	   R   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_assert_with_tuple_argç  s    c            sA   d t  f ‡  f d †  ƒ  Y} t | d ƒ ƒ ‰  d ˆ  _ ˆ  ` d  S(   Nt   Nastyc              s   e  Z ‡  f d  †  Z RS(   c            s
   ˆ  `  d  S(   N(   Rj   (   Rj   (   R   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   __del__ò  s    (   R   R   RÌ   (    (   R   (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRË   ñ  s   RJ   (    (   R   R4   Rp   Rj   (   R	   RË   (    (   R   sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_bad_exception_clearingí  s    	(   R   R   R   R   RG   RQ   R   Rh   Rn   R   R¢   R¦   R©   R¬   R­   R±   R³   Rµ   R¸   R¼   RÆ   RÇ   RÊ   RÍ   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR      s(   	
		Q	'	j									%		!			t   ExcWithOverriddenStrc           B   s    e  Z d  Z d „  Z d „  Z RS(   s|   Subclass of Exception that accepts a keyword 'msg' arg that is
    returned by __str__. 'msg' won't be included in self.argsc         O   s/   | j  d ƒ |  _ t t |  ƒ j | | Ž  d  S(   NRJ   (   t   popRJ   t   superRÎ   RT   (   R	   Rp   t   kwargs(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRT   þ  s    c         C   s   |  j  S(   N(   RJ   (   R	   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR
     s    (   R   R   t   __doc__RT   R
   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRÎ   û  s   	t   TestSameStrAndUnicodeMsgc           B   sw   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 e d	 „  ƒ Z d
 „  Z d „  Z RS(   sB   unicode(err) should return the same message of str(err). See #6108c         C   s6   |  j  t | ƒ | ƒ |  j  t | ƒ t | ƒ ƒ d S(   s>   Helper function that checks if str(exc) == unicode(exc) == msgN(   R   R   R´   (   R	   R   RJ   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   check_same_msg  s    c      
   C   s‚   t  d d ƒ t d d ƒ t d ƒ t d	 d
 d d d ƒ t d	 d d d d ƒ g } x* | D]" } |  j t | ƒ t | ƒ ƒ qX Wd S(   s&   Check same msg for built-in exceptionss   invalid syntaxs   <string>i   i   s   2+*3i   s   No such file or directorys    both should have the same quotesR„   s   Ã i    s   ordinal not in range(128)u   áˆ´N(   s   <string>i   i   s   2+*3(   R.   R$   R'   R�   R�   R   R   R´   (   R	   R   t	   exception(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_builtin_exceptions  s    	c         C   s   |  j  t ƒ  d ƒ d S(   s(   Check same msg for Exception with 0 argsRo   N(   RÔ   R   (   R	   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_0_args  s    c         C   sf   x' d D] } |  j  t d | ƒ | ƒ q Wt d d ƒ } |  j t t | ƒ |  j t | ƒ d ƒ d S(   s@   Check same msg for exceptions with 0 args and overridden __str__Rq   u   fooRJ   u   fÃ¶Ã¶N(   Rq   u   foo(   RÔ   RÎ   R6   R�   R   R   R´   (   R	   RJ   R   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt#   test_0_args_with_overridden___str__$  s
    c         C   s`   x$ d D] } |  j  t | ƒ | ƒ q Wt d ƒ } |  j t t | ƒ |  j t | ƒ d ƒ d S(   s(   Check same msg for Exceptions with 1 argRq   u   foou   fÃ¶Ã¶N(   Rq   u   foo(   RÔ   R   R6   R�   R   R   R´   (   R	   t   argR   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt
   test_1_arg1  s
    c         C   sl   x* d D]" } |  j  t d d | ƒ| ƒ q Wt d d d ƒ} |  j t t | ƒ |  j t | ƒ d ƒ d S(   s?   Check same msg for exceptions with overridden __str__ and 1 argRq   u   fooRÙ   RJ   u   fÃ¶Ã¶N(   Rq   u   foo(   RÔ   RÎ   R6   R�   R   R   R´   (   R	   RJ   R   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt"   test_1_arg_with_overridden___str__=  s
     c         C   s@   d d d g } x* | D]" } |  j  t | Œ  t | ƒ ƒ q Wd
 S(   s,   Check same msg for Exceptions with many argsi   Rq   i   u   fooRu   i   u   fÃ¶Ã¶u   barRv   N(   i   Rq   (   i   u   fooRu   (   i   u   fÃ¶Ã¶u   barRv   (   RÔ   R   R”   (   R	   t   argslistRp   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_many_argsJ  s
    	c         C   s~   x6 d	 D]. } t  d d d d | ƒ} |  j | | ƒ q Wt  d d d d d ƒ} |  j t t | ƒ |  j t | ƒ d ƒ d S(
   sC   Check same msg for exceptions with overridden __str__ and many argsRq   u   foot   arg1u   arg2u   fÃ¶Ã¶RJ   u   arg3N(   Rq   u   foo(   RÎ   RÔ   R6   R�   R   R   R´   (   R	   RJ   R   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt&   test_many_args_with_overridden___str__U  s    	c   
      C   s˜  d d  l  } d } d } |  j t | j d ƒ | j d ƒ } |  j t | ƒ t ƒ |  j t | t ƒ ƒ |  j	 | j
 ƒ | j d | ƒ } |  j | j
 | ƒ | j d d | ƒ} |  j t | | ƒ ƒ d	 t f d
 „  ƒ  Y} | j d | | | f ƒ } |  j t | | ƒ ƒ |  j t | | ƒ ƒ |  j | j
 | ƒ | j d d | i d d 6ƒ }	 |  j t |	 | ƒ ƒ |  j |	 j d ƒ |  j |	 j
 d ƒ d  S(   Niÿÿÿÿs   This is a test docstring.s   This is another test docstring.t   error1s   _testcapi.error1s   _testcapi.error2s   _testcapi.error3t   baset   Cc           B   s   e  Z RS(    (   R   R   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRâ   }  s   s   _testcapi.error4s   _testcapi.error5Ro   i   R®   (   RX   R6   R1   t   make_exception_with_doct   assertIsR“   R^   t
   issubclassR   t   assertIsNoneRÒ   R   R†   R®   (
   R	   RX   t   doc2t   doc4Rà   t   error2t   error3Râ   t   error4t   error5(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_exception_with_docd  s2    	c         C   s(  d d d „  ƒ  Y} d | f d „  ƒ  Y} d d d „  ƒ  Y} xå | | | f D]Ô } | ƒ  } t  ƒ  �
 } ~ Wd  QX| j ƒ  } |  j | d ƒ | | k r« |  j d | ƒ n |  j d	 | ƒ | | k rê |  j d
 | ƒ |  j d | ƒ n  |  j d | ƒ |  j d | ƒ |  j | j d ƒ ƒ qL Wd  S(   Nt	   BrokenDelc           B   s   e  Z d  „  Z RS(   c         S   s   t  d ƒ } | ‚ d  S(   Ns   del is broken(   R4   (   R	   R   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRÌ   �  s    (   R   R   RÌ   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRî   Ž  s   t
   BrokenReprc           B   s   e  Z d  „  Z RS(   c         S   s   t  d ƒ ‚ d  S(   Ns   repr() is broken(   R   (   R	   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyR   •  s    (   R   R   R   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRï   ”  s   t   BrokenExceptionDelc           B   s   e  Z d  „  Z RS(   c         S   s   t  ƒ  } | ‚ d  S(   N(   R   (   R	   R   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRÌ   ™  s    	(   R   R   RÌ   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRð   ˜  s   s   Exception.* ignoreds   <object repr() failed>RÌ   R   s   <exception repr() failed>R4   s   del is brokens   
(    (    (   R   t   getvaluet   assertRegexpMatchesRÃ   R^   R`   (   R	   Rî   Rï   Rð   t
   test_classt   objRÄ   t   report(    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_unraisableŒ  s$    		c         C   sî   xç t  t f D]Ù } y | d ƒ } | ‚ Wn6 | k
 ra t ƒ  � } t j t j ƒ  Œ  Wd  QXn X| j ƒ  } |  j d | ƒ |  j d | ƒ |  j | j | ƒ | t k rÀ |  j d | ƒ n |  j d | ƒ |  j	 | j
 d ƒ ƒ q Wd  S(   Ns   test messages   test_exceptions.pys	   raise excs   <exception str() failed>s   
(   R4   R   R   R8   t   __excepthook__RZ   Rñ   RÃ   R   R^   R`   (   R	   t   exc_typeR   RÄ   Rõ   (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   test_unhandled°  s    
(   R   R   RÒ   RÔ   RÖ   R×   RØ   RÚ   RÛ   RÝ   Rß   R   Rí   Rö   Rù   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyRÓ     s   								(	$c           C   s   t  t t ƒ d  S(   N(   R   R   RÓ   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt	   test_mainÅ  s    t   __main__(   Ra   R8   t   unittestR•   R–   t   test.test_supportR    R   R   R   R   R   t   test.test_pep352R   R   R   t   TestCaseR   RÎ   RÓ   Rú   R   (    (    (    sŠ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_exceptions.pyt   <module>   s   .ÿ é
À	