ó
ŒwÛjc           @   sX  d  d l  Z  d  d l Z d  d l Z 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	 e j
 j e j
 j e j
 j e ƒ d ƒ ƒ Z e j d ƒ Z e e e ƒ j ƒ  e d ƒ e j Ue j Z e j e j k rù e d ƒ ‚ n  e e j e j <d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ i  d „ Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ  d e  f d „  ƒ  YZ! d e f d „  ƒ  YZ" d e" f d „  ƒ  YZ# d e f d „  ƒ  YZ$ d e$ f d „  ƒ  YZ% d „  Z& d „  Z' e d  k rTd! e j( k rJe& e j) e j* ƒ qTe' ƒ  n  d S("   iÿÿÿÿN(   t   test_supports   pickletester.pys   test.pickletestert   execs/   Did not expect to find test.pickletester loadedt   DumpCPickle_LoadPicklec           B   s&   e  Z e Z d  e d „ Z d „  Z RS(   i    c         C   s   t  j | | ƒ S(   N(   t   cPicklet   dumps(   t   selft   argt   protot   fast(    (    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_xpickle.pyR   '   s    c         C   s   t  j | ƒ S(   N(   t   picklet   loads(   R   t   buf(    (    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_xpickle.pyR
   +   s    (   t   __name__t
   __module__t   KeyErrort   errort   FalseR   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_xpickle.pyR   #   s   t   DumpPickle_LoadCPicklec           B   s)   e  Z e j Z d  e d „ Z d „  Z RS(   i    c         C   s   t  j | | ƒ S(   N(   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_xpickle.pyR   3   s    c         C   s   t  j | ƒ S(   N(   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_xpickle.pyR
   7   s    (   R   R   R   t   BadPickleGetR   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_xpickle.pyR   /   s   	c         C   s4   |  | k r, t  j |  d ƒ d k | |  <n  | |  S(   s  Check whether the given name is a valid Python binary and has
    test.test_support.

    This respects your PATH.

    Args:
        name: short string name of a Python binary such as "python2.4".

    Returns:
        True if the name is valid, False otherwise.
    s    -c "import test.test_support"i    (   t   ost   system(   t   namet   cache(    (    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_xpickle.pyt   have_python_version;   s     t   AbstractCompatTestsc           B   s’   e  Z d Z d Z d Z d  „  Z d „  Z d e d „ Z	 d „  Z
 d Z d Z d Z d „  Z d Z d Z d „  Z d Z d Z d Z d Z d Z RS(   c         C   sg   |  j  |  j ƒ |  j  |  j ƒ |  j  |  j ƒ t j d ƒ t |  j ƒ sc |  j d |  j ƒ n  d  S(   Nt   xpickles   %s not available(   t
   assertTruet   pythont   moduleR   R    t   requiresR   t   skipTest(   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_xpickle.pyt   setUpR   s    c   	      C   s¨   t  } | d d	 k r# | d  } n  |  j j | | f | ƒ } t j | | d g d t j d t j d t j ƒ} | j | ƒ \ } } | j d k r¤ t | ƒ ‚ n  | S(
   sÌ  Bounce a pickled object through another version of Python.

        This will pickle the object, send it to a child process where it will be
        unpickled, then repickled and sent back to the parent process.

        Args:
            python: the name of the Python binary to start.
            obj: object to pickle.
            proto: pickle protocol number to use.

        Returns:
            The pickled data received from the child process.
        iÿÿÿÿt   ct   ot   workert   stdint   stdoutt   stderri    (   R    R!   (	   t   __file__R   R   t
   subprocesst   Popent   PIPEt   communicatet
   returncodet   RuntimeError(	   R   R   t   objR   t   targett   dataR"   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_xpickle.pyt   send_to_workerZ   s    		i    c         C   s   |  j  |  j | | ƒ S(   N(   R0   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_xpickle.pyR   w   s    c         C   s   |  j  j | ƒ S(   N(   R   R
   (   R   t   input(    (    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_xpickle.pyR
   z   s    c   
   	   C   s  d d g } g  | D] } | ^ q } d d d d d d d	 d
 d g	 } | g  | D] } | ^ qQ } | | | } x? | D]7 } |  j  | d ƒ } |  j | ƒ } |  j | | ƒ qz WxW t j d D]H }	 x? | D]7 } |  j  | |	 ƒ } |  j | ƒ } |  j | | ƒ qÐ WqÃ Wd  S(   Ng       g+æp‹h  g        gà®Z¤î*) g_DÅø…9gš™™™™™¹?g      à?g…ëQ¸	@g‘mÎ"wp@gêWôTáßDgêŒ 9Y>)Fi    i   (   R   R
   t   assertEqualt   pickletestert	   protocols(
   R   t   for_bin_protost   xt   neg_for_bin_protost   test_valuest   test_proto0_valuest   valueR	   t   gotR   (    (    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_xpickle.pyt
   test_float†   s    c         C   sˆ   t  j s |  j d ƒ n  d d d d d g } xS t j D]H } x? | D]7 } |  j | | ƒ } |  j | ƒ } |  j | | ƒ qE Wq8 Wd  S(	   Ns   no unicode supportu    u   <\u>u   <\%c>i4  u   <
>u   <\>u   <\áˆ´>(   R    t   have_unicodeR   R3   R4   R   R
   R2   (   R   t   endcasesR   t   ut   pt   u2(    (    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_xpickle.pyt   test_unicode¡   s    	N(   R   R   t   NoneR   R   R   R   R0   R   R   R
   t   test_global_ext1t   test_global_ext2t   test_global_ext4R<   t   test_unicode_high_planet   test_dynamic_classRB   t%   test_recursive_list_subclass_and_instt&   test_recursive_tuple_subclass_and_instt%   test_recursive_dict_subclass_and_instt   test_recursive_set_and_instt!   test_recursive_frozenset_and_inst(    (    (    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_xpickle.pyR   L   s&   					t   CPicklePython24Compatc           B   s)   e  Z e Z d  Z e j Z d Z d Z	 RS(   s	   python2.4N(
   R   R   R   R   R   R   R   RC   t   test_reduce_calls_baset   test_reduce_ex_calls_base(    (    (    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_xpickle.pyRN   ¶   s
   	t   PicklePython24Compatc           B   s   e  Z e Z e Z RS(    (   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_xpickle.pyRQ   Á   s   t   CPicklePython25Compatc           B   s   e  Z e Z d  Z e j Z RS(   s	   python2.5(   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_xpickle.pyRR   È   s   t   PicklePython25Compatc           B   s   e  Z e Z e Z RS(    (   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_xpickle.pyRS   Î   s   t   CPicklePython26Compatc           B   s   e  Z e Z d  Z e j Z RS(   s	   python2.6(   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_xpickle.pyRT   Õ   s   t   PicklePython26Compatc           B   s   e  Z e Z e Z RS(    (   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_xpickle.pyRU   Û   s   t   CPicklePython27Compatc           B   s   e  Z e Z d  Z e j Z RS(   s	   python2.7(   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_xpickle.pyRV   á   s   t   PicklePython27Compatc           B   s   e  Z e Z e Z RS(    (   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_xpickle.pyRW   ç   s   c         C   s2   t  j |  ƒ } | \ } } t  j | | | ƒ d  S(   N(   R   t   loadt   dump(   t	   in_streamt
   out_streamt   messaget   protocolR-   (    (    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_xpickle.pyt   worker_mainí   s    c           C   s,   t  j t t t t t t t t	 t
 t ƒ
 d  S(   N(   R    t   run_unittestR   R   RN   RR   RT   RV   RQ   RS   RU   RW   (    (    (    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_xpickle.pyt	   test_mainó   s    t   __main__R"   (+   R   R   t   os.pathR	   R'   t   syst   typest   unittestt   testR    t   patht   abspatht   joint   dirnameR&   t   mod_patht
   ModuleTypeR3   t   compilet   opent   readt   __dict__t   AbstractPickleTestsR   t   modulesR,   R   R   R   R   RN   RQ   RR   RS   RT   RU   RV   RW   R^   R`   t   argvR#   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_xpickle.pyt   <module>   sD   !#	j		