ó
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 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 m Z m Z m Z m Z m Z m Z m Z d  d l m Z d  d l m Z d   Z d   Z d   Z d e	 j f d	     YZ d
 e	 j f d     YZ d e	 j f d     YZ d e	 j f d     YZ d e	 j f d     YZ  e! d  Z" e# d k r“d  d l$ m" Z" e"   n  d S(   i’’’’N(   t   unlinkt   TESTFNt   unloadt   run_unittestt   rmtreet	   is_jythont   check_warningst   EnvironmentVarGuard(   t   symlink_support(   t   script_helperc         C   sC   |  t  j d |  t  j d |  t  j d |  t  j d |  d f S(   Nt   pyt   pyct   pyot   pyws	   $py.class(   t   ost   extsep(   t   name(    (    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_import.pyt   _files   s
    c         C   s]   xV t  |   D]H } y t j | d  Wq t k
 rT } | j t j k rU   qU q Xq Wd  S(   Ni  (   R   R   t   chmodt   OSErrort   errnot   ENOENT(   R   t   ft   exc(    (    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_import.pyt   chmod_files   s    c         C   s%   x t  |   D] } t |  q Wd  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_import.pyt   remove_files"   s    t   ImportTestsc           B   s
  e  Z d    Z e Z d   Z d   Z d   Z e j e	 j
 d k d  e j e j d  d     Z e j e j d  d    Z d	   Z d
 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   s   t  t  d  S(   N(   R   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_import.pyt   tearDown)   s    c         C   s5   y d d  l  } Wn t k
 r# n X|  j d  d  S(   Ni’’’’s3   import of RAnDoM should have failed (case mismatch)(   t   RAnDoMt   ImportErrort   fail(   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_import.pyt   test_case_sensitivity-   s
    c         C   s   d d l  m } d  S(   Ni’’’’(   t   double_const(   t   testR!   (   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_import.pyt   test_double_const7   s    c            s     f d   } t  j j d t j  zW | t j d  t  j j d  r{ x- d d d d d	 d
 g D] } | |  qd Wn  Wd  t  j d =Xd  S(   Nc   	   	      s  t  |  } t  t j d } t r. t  d } n t  t j d } t | d  X } | d |  d f IJt j d  } t j d  } | d I| IJ| d	 I| IJWd  QXzu y t t   } Wn* t k
 rē }   j	 d
 |  | f  n5 X  j
 | j | d |    j
 | j | d |  Wd  t |  XzH y t j sJt j |  n  Wn$ t k
 rq}   j	 d |  n XWd  t |  t |  t t   Xd  S(   NR   s	   $py.classR   t   ws)   # This tests Python's ability to import as   file.ič  s   a =s   b =s   import from %s failed: %ss'   module loaded (%s) but contents invalids    import from .pyc/.pyo failed: %s(   R   R   R   R   t   opent   randomt	   randranget
   __import__R   R   t   assertEqualt   at   bR    t   syst   dont_write_bytecodet   impt   reloadR   (	   t   extt   sourceR   R   R   R*   R+   t   modt   err(   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_import.pyt   test_with_extension=   s>    

	  	

i    R
   t   wins   .PYs   .Pys   .pYs   .pyws   .PYWs   .pYw(   R,   t   patht   insertR   t   curdirR   t   platformt
   startswith(   R   R4   R0   (    (   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_import.pyt   test_import<   s    't   posixs%   test meaningful only on posix systemss*   test meaningful only when writing bytecodec         C   sI  t  j d  } t j j d t  j  zń t t  j d } t | d  j	   } t  j
 | t j t j Bt j Bt j Bt j Bt j B t t  | d } t  j j |  sŁ | d } t  j j |  sŁ |  j d  qŁ n  t  j |  } |  j t j | j  t j t j Bt j B Wd  t  j |  t t  t t  t j d =Xd  S(   Ni   i    R
   R$   t   ct   osC   __import__ did not result in creation of either a .pyc or .pyo file(   R   t   umaskR,   R6   R7   R8   R   R   R%   t   closeR   t   statt   S_IRUSRt   S_IRGRPt   S_IROTHt   S_IXUSRt   S_IXGRPt   S_IXOTHR(   t   existsR   R)   t   S_IMODEt   st_modeR   R   (   R   t   oldmaskt   fnameR   t   fnt   s(    (    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_import.pyt   test_execute_bit_not_copiedm   s(    	-




c         C   so  t  j j d t j  t t j d } zt | d   } | j d  Wd  QXt j	 |  } t j
 | | j | j d f  t j | d  t t  } |  j | j d  t j | d  t | d   } | j d	  Wd  QXt t  t t  } |  j | j d
  t |  t t  t t  } |  j | j d
  Wd  t t  t t  t t  t  j d =Xd  S(   Ni    R
   R$   s   x = 'original'
i įõi   t   originali  s   x = 'rewritten'
t	   rewritten(   R,   R6   R7   R   R8   R   R   R%   t   writeRA   t   utimet   st_atimet   st_mtimeR   R(   R)   t   xR   R    R   R   (   R   RL   R   RN   t   m1t   m2t   m3(    (    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_import.pyt&   test_rewrite_pyc_with_read_only_source   s0     





c         C   s}   t  j } t  j } t   \ t j d  } t j d |  } |  j t  |  |  j | | j  |  j | | j  Wd  QXd  S(   NR   (	   R   R6   t   getenvR   R.   t   find_modulet   load_modulet   assertIst   assertIsNot(   R   t	   orig_patht   orig_getenvRV   t   new_os(    (    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_import.pyt   test_imp_moduleÆ   s    
		
t   longlistc         B   sÜ   | e  j d } e | d  E } | j d  x! e d  D] } | j d  q= W| j d  Wd  QXe | d   } e j |  Wd  QXe |  e j	 j
 d  d	 | d  Ue j	 d
 =e | d  e | d  d  S(   NR
   s   w+s   d = [
ičż  s   "",
t   ]t   rt    s   import i’’’’R=   R>   (   R   R   R%   RR   t   ranget
   py_compilet   compileR    R,   R6   t   append(   R   t   modulet   filenameR   t   i(    (    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_import.pyt   test_module_with_large_stackĀ   s    

c         C   s°   t  t j d } t | d   } | d IJWd  QXt j j d t j  zK xD d d d g D]3 } |  j t	 t
 t   |  j t  t j d |  q\ WWd  t j d =t t   Xd  S(	   NR
   R$   s
   a = 1 // 0i    i   i   i   s'   damaged module in sys.modules on %i try(   R   R   R   R%   R,   R6   R7   R8   t   assertRaisest   ZeroDivisionErrorR(   t   assertNotInt   modulesR   (   R   R1   R   Rn   (    (    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_import.pyt   test_failing_import_sticksŻ   s    
c         C   se  t  t j d } t | d   } | d IJ| d IJWd  QXt j j d t j  zģ t t   } |  j	 t  t j
  |  j | j d d  |  j | j d d  t t   t | d   } | d	 IJ| d
 IJWd  QX|  j t t j |  t j
 j t   } |  j | d  d  |  j | j d d  |  j | j d d  Wd  t j d =t t   t t   Xd  S(   NR
   R$   s   a = 1s   b = 2i    i   s!   module has wrong attribute valuesi   s   a = 10s	   b = 20//0s$   expected module to be in sys.modulesi
   (   R   R   R   R%   R,   R6   R7   R8   R(   t   assertInRs   R)   R*   R+   R   Rp   Rq   R.   R/   t   getR_   t   NoneR   (   R   R1   R   R2   (    (    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_import.pyt   test_failing_reloadī   s,    




c         C   sA   t  j j d t j j t   z d d  l } Wd  t  j d =Xd  S(   Ni    i’’’’(   R,   R6   R7   R   t   dirnamet   __file__t   infinite_reload(   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_import.pyt   test_infinite_reload  s    c         C   ss   d d  l  } d d  l } |  j | | | j  |  j t | j d   d d  l j } |  j | | j | j  d  S(   Ni’’’’Rz   (   R"   t   test.test_supportR^   t   __name__t
   assertTruet   hasattrt   test_support(   R   RV   R"   t   y(    (    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_import.pyt   test_import_name_binding!  s    c         C   s0   t  d t f   |  j t t d  Wd  QXd  S(   NRg   s   site-packages(   R   t   ImportWarningRp   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_import.pyt&   test_import_initless_directory_warning,  s    c         C   sR   t  j j t  } |  j t   } t |  Wd  QX|  j d | j j	 d  d  S(   Ns$   Import by filename is not supported.i    (
   R   R6   t   abspathR   Rp   R   R(   R)   t	   exceptiont   args(   R   R6   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_import.pyt   test_import_by_filename2  s
    	c         C   sA   t  j d t t j d   } z t  j |  Wd  t |  Xd  S(   NRg   s               import sys
            class C:
               def __del__(self):
                  import imp
            sys.argv.insert(0, C())
            (   R	   t   make_scriptR   t   textwrapt   dedentt   assert_python_okR    (   R   t   testfn(    (    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_import.pyt!   test_import_in_del_does_not_crash9  s
    c         C   sR   t  d } t j |  z& |  j t t f t j t  d g  Wd  t j |  Xd  S(   Ns   .pyt   .(	   R   R   t   mkdirRp   R   t   IOErrorR.   R\   t   rmdir(   R   R1   (    (    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_import.pyt   test_bug7732G  s    
c         C   s	  t  j j d t j  z× t d } | t r2 d n d } t | d   } Wd  QXy t j | d d f  Wng t	 k
 r |  j
 d	  nJ t k
 rŌ } | j t t d
 d   k r»   n  |  j
 d j |   n Xt t  t j |  Wd  t  j d =t t  Xd  S(   Ni    s   .pyR=   R>   R$   i   i!   i   s-   cannot set modification time to large integert	   EOVERFLOWs2   cannot set modification time to large integer ({})I       Iū’’’   I       Iū’’’   (   R,   R6   R7   R   R8   R   t	   __debug__R%   RS   t   OverflowErrort   skipTestR   R   t   getattrRw   t   formatR(   RA   R   (   R   R1   t   compiledR   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_import.pyt   test_timestamp_overflowP  s$    


c      
   C   sv  t  j j d t j  zHd } d } x5t | |  D]$\ } } t | } | d } | t rd d n d } t | d	   } | j	 d
  Wd  QXt j
 | | | f  t |  }	 t j j |  sŽ t |  |  j d  n  t t j |  j  d @}
 t | d  * } t j d | j d  d  d } Wd  QXt |  t |  |  j |
 |  q5 WWd  t  j j d  Xd  S(   Ni    i ¢’Ni ļOt   spamt   eggss   .pyR=   R>   R$   s   # Just testing
x=1, 2, 3
s   Couldn't create .pyc/.pyo file.I’’’’    t   rbs   <Li   i   (   i ¢’Ni ļO(   R   R   (   R,   R6   R7   R   R8   t   zipR   R   R%   RR   RS   R(   RH   R    R   t   intRA   RU   t   structt   unpackt   readR)   t   pop(   R   t   mtimest   tailst   mtimet   tailRl   R1   R   R   t   mt   mtime1t   mtime2(    (    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_import.pyt   test_pyc_mtimeh  s,    


)

c         C   sņ   t  j j t  } t  j |  |  j t |  t  j j | d  } t  j |  t t  j j | d  d   } | j	 d  Wd  QXt t  j j | d  d   } | j	 d  Wd  QXt
 j j d |  |  j t
 j j d  d d  l } d  S(	   Nt   sas   __init__.pyR$   s	   import v1s   v1.pys>   import sys;sys.modules['sa'] = sys.modules[__name__];import sai    i’’’’(   R   R6   R   R   R   t
   addCleanupR   t   joinR%   RR   R,   R7   R¦   RÆ   (   R   t   dir_namet   pkg_dirt	   init_filet   v1_fileRÆ   (    (    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_import.pyt"   test_replace_parent_in_sys_modules  s    !!c      	   C   s   |  j  t   } t d d d g Wd  QX|  j d t | j   |  j  t   } t d d d g Wd  QX|  j d t | j   d  S(   Nt	   encodingst   fromlistu   aliasess   must be str, not unicodei   s   must be str, not int(   Rp   t	   TypeErrorR(   Ru   t   strR   (   R   t   cm(    (    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_import.pyt   test_fromlist_type”  s    (   R~   t
   __module__R   t   setUpR    R#   R;   t   unittestt
   skipUnlessR   R   t   skipIfR,   R-   RO   RZ   Rc   Ro   Rt   Rx   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_import.pyR   '   s2   		
		1#			)	
								(	t   PycRewritingTestsc           B   s   e  Z d  Z d Z e j j e  Z e j j	 e e  e j
 d Z e e rS d n d Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z RS(   t   unlikely_module_names§   
import sys
code_filename = sys._getframe().f_code.co_filename
module_filename = __file__
constant = 1
def func():
    pass
func_filename = func.func_code.co_filename
R
   R=   R>   c         C   s}   t  j |  _ t  j j |  j d   |  _ t j	 |  j
  t |  j d   } | j |  j  Wd  QXt  j j d |  j
  d  S(   NR$   i    (   R,   R6   t   sys_pathRs   R¦   t   module_nameRw   t   orig_moduleR   R   R²   R%   t	   file_nameRR   t   module_sourceR7   (   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_import.pyR¾   ½  s    c         C   sj   |  j  t j (|  j d  k	 r2 |  j t j |  j <n t |  j  t |  j	  t |  j
  t |  j  d  S(   N(   RÄ   R,   R6   RĘ   Rw   Rs   RÅ   R   R    RĒ   t   compiled_nameR   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_import.pyR   Å  s    c         C   s*   t    } t |  j | |  t j |  j S(   N(   t   globalsR(   RÅ   R,   Rs   (   R   t   ns(    (    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_import.pyt   import_moduleĻ  s    	c         C   s¹   |  j    } |  j | j |  j  |  j | j |  j  |  j | j |  j  t j |  j =|  j    } t j	 s |  j | j |  j
  n  |  j | j |  j  |  j | j |  j  d  S(   N(   RĢ   R)   t   module_filenameRĒ   t   code_filenamet   func_filenameR,   Rs   RÅ   R-   RÉ   (   R   R2   (    (    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_import.pyt   test_basicsŌ  s    	c         C   sh   t  j |  j d d |  j   } |  j | j |  j  |  j | j |  j  |  j | j |  j  d  S(   Nt   dfiles   another_module.py(	   Ri   Rj   RĒ   RĢ   R)   RĶ   RÉ   RĪ   RĻ   (   R   R2   (    (    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_import.pyt   test_incorrect_code_nameą  s
    c         C   sx   d } t  j |  j d | t j |  j  |  j   } |  j | j |  j  |  j | j	 |  |  j | j
 |  d  S(   Ns   another_module.pyRŃ   (   Ri   Rj   RĒ   R   t   removeRĢ   R)   RĶ   RÉ   RĪ   RĻ   (   R   t   targetR2   (    (    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_import.pyt   test_module_without_sourceē  s    c         C   sA  t  j |  j  t |  j d  % } | j d  } t j |  } Wd  QXt | j	  } t
 j } | j d  } | | | <t |  | j | j | j | j | j t |  | j | j | j | j | j | j | j | j  } t |  j d  $ } | j |  t j | |  Wd  QX|  j   } |  j | j  j | j  d  S(   NR    i   i   t   wb(!   Ri   Rj   RĒ   R%   RÉ   R„   t   marshalt   loadt   listt	   co_constst	   test_maint	   func_codet   indext   typet   co_argcountt
   co_nlocalst   co_stacksizet   co_flagst   co_codet   tuplet   co_namest   co_varnamest   co_filenamet   co_namet   co_firstlinenot	   co_lnotabt   co_freevarst   co_cellvarsRR   t   dumpRĢ   R)   t   constant(   R   R   t   headert   codet	   constantst   foreign_codet   posR2   (    (    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_import.pyt   test_foreign_codeš  s$    	
(   R~   R½   RÅ   RČ   R   R6   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_import.pyRĀ   Ŗ  s   	 		
					t
   PathsTestsc           B   sJ   e  Z e Z d    Z d   Z d   Z d   Z e j	 d k rH e Z
 n  RS(   c         C   s!   t  j |  j  t j |  _ d  S(   N(   R   R   R6   R,   t   syspath(   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_import.pyR¾     s    c         C   s   t  |  j  |  j t j (d  S(   N(   R   R6   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_import.pyR     s    c         C   s{   t  t j j |  j d  d   } | j d  Wd  QXt j j |  j d  t d  } |  j | j	 d  t
 d  d  S(   Ns   test_trailing_slash.pyR$   s    testdata = 'test_trailing_slash't   /t   test_trailing_slash(   R%   R   R6   R±   RR   R,   Rk   R(   R)   t   testdataR   (   R   R   R2   (    (    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_import.pyRų     s    $c   	      C   s+  t  t j j |  j d  d   } | j d  Wd  QXt j j |  j  } d d  l } | j   } | d } d | | f } | | d 7} y t j |  WnN t	 k
 rķ } | j
 t
 j t
 j t
 j f k rē |  j d | f  n    n Xt j j |  t d	  } |  j | j d	  t d	  d  S(
   Ns   test_trailing_slash.pyR$   s    testdata = 'test_trailing_slash'i’’’’i    s   \\%s\%s$i   s%   cannot access administrative share %rRų   (   R%   R   R6   R±   RR   R   t   sockett   gethostnamet   listdirR   R   t   EPERMt   EACCESR   R   R,   Rk   R(   R)   Rł   R   (	   R   R   R6   Rś   t   hnt   drivet   uncR   R2   (    (    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_import.pyt   _test_UNC_path  s$    $
!t   win32(   R~   R½   R   R6   R¾   R   Rų   R  R,   R9   t   test_UNC_path(    (    (    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_import.pyRõ     s   					t   RelativeImportTestsc           B   s2   e  Z d    Z e Z d   Z d   Z d   Z RS(   c         C   s   t  d  d  S(   Ns   test.relimport(   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_import.pyR   6  s    c         C   s*   d d l  m } |  j t | d   d  S(   Ni   (   t	   relimportR  (   Rg   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_import.pyt   test_relimport_star:  s    c            s$    f d   }   f d   } t  d d d d    |   |   t  d d d d    |   |   t  d d d d    t d	 t f   |   Wd  QX|  j t |  t  d d d d    t d	 t f   |   Wd  QX|  j t |  t  d t      |  j t |  |  j t |  d  S(
   Nc              s   d   Ud  S(   Ns   from os import path(    (    (   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_import.pyt   check_absoluteA  s    c              s   d   Ud  S(   Ns   from . import relimport(    (    (   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_import.pyt   check_relativeC  s    t   __package__R"   R~   s   test.notarealmodules   notarealpkg.notarealmodulet   foos   .+foo(   t   dictR   t   RuntimeWarningRp   t   SystemErrort   objectt
   ValueError(   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_import.pyt   test_issue3221?  s&    c         C   s7   |  j  t  " d d l m } |  j d  Wd  QXd  S(   Ni   (   t   seps>   explicit relative import triggered an implicit absolute import(   Rp   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_import.pyt#   test_absolute_import_without_futurea  s    (   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_import.pyR  4  s
   			"t   TestSymbolicallyLinkedPackagec           B   so   e  Z d  Z d   Z e d    Z e j e e	 d  pI e	 j
   d	 k d  e j d     Z d   Z RS(
   t   samplec         C   s²   t  j j |  j  r( t j |  j  n  t  j j |  j  rP t j |  j  n  t	 j |  _
 t  j |  j  t  j j |  j d  } t | d  j   t j |  j |  j  d  S(   Ns   __init__.pyR$   (   R   R6   RH   t   taggedt   shutilR   t   package_nameR   t   remove_symlinkR,   t   orig_sys_pathR   R±   R%   R@   t   symlink(   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_import.pyR¾   n  s    c         C   s   |  j  d S(   Ns   -tagged(   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_import.pyR    s    t   getwindowsversioni   i    s   Windows Vista or later requiredc         C   s   d g t  j (t |  j  d  S(   NR   (   R,   R6   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_import.pyt   test_symlinked_dir_importable  s    c         C   sa   t  j j |  j  r( t j |  j  n  t  j j |  j  rP t j |  j  n  |  j	 t
 j (d  S(   N(   R   R6   RH   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_import.pyR     s
    (   i   i    (   R~   R½   R  R¾   t   propertyR  Ræ   RĄ   R   R,   R  R   t   skip_unless_symlinkR  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_import.pyR  k  s   	c         C   s   t  t t t t t  d  S(   N(   R   R   RĀ   Rõ   R  R  (   t   verbose(    (    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_import.pyRŪ     s    t   __main__(   RŪ   (%   R   R.   R×   R   Ri   R&   RA   R£   R,   Ræ   R   R  R}   R    R   R   R   R   R   R   R   R"   R   R	   R   R   R   t   TestCaseR   RĀ   Rõ   R  R  Rw   RŪ   R~   t   test.test_import(    (    (    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_import.pyt   <module>   s6   :			’ [/71