ó
Hc           @   sD   d  d l  Z  d  d l Z d   Z d   Z e d k r@ e   n  d S(   i˙˙˙˙Nc           C   s.   t  j j d  t  j j   t  j j   d  S(   Ns   grandchild started(   t   syst   stdoutt   writet   flusht   stdint   read(    (    (    sH   /usr/lib/python2.7/dist-packages/twisted/internet/test/process_helper.pyt
   grandchild   s    c       
   C   s  t  j d d k rt  j d d k ró d d  l }  d d  l } | j   } |  j |  j  | _ |  j |  j  | _	 |  j |  j
  | _ t  j } t j j t  } t j j t  } | j d  d j | | d f  d  d  d d t j | | 	 qt j   d k rt   qn t   d  S(	   Ni   t   childi   t   windowsi˙˙˙˙t    R   i    (   R    t   argvt   win32apit   win32processt   STARTUPINFOt   GetStdHandlet   STD_INPUT_HANDLEt	   hStdInputt   STD_OUTPUT_HANDLEt
   hStdOutputt   STD_ERROR_HANDLEt	   hStdErrort
   executablet   ost   patht   dirnamet   __file__t   basenamet   CreateProcesst   Nonet   joint   environt   forkR   (   t   apit   proct   infot   pythont	   scriptDirt
   scriptName(    (    sH   /usr/lib/python2.7/dist-packages/twisted/internet/test/process_helper.pyt   main   s     	t   __main__(   R    R   R   R&   t   __name__(    (    (    sH   /usr/lib/python2.7/dist-packages/twisted/internet/test/process_helper.pyt   <module>   s   		