관리-도구
편집 파일: forkserver.cpython-35.opt-2.pyc
���] � @ sd 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 d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d d d g Z d Z e j d � Z Gd d � d e � Z d d d d � Z d d � Z d d � Z d d � Z e � Z e j Z e j Z e j Z e j Z d S)� N� )� connection)�process)� reduction)�semaphore_tracker)�spawn)�util�ensure_running�get_inherited_fds�connect_to_new_process�set_forkserver_preload� �Qc @ sL e Z d Z d d � Z d d � Z d d � Z d d � Z d d � Z d S)� ForkServerc C s: d | _ d | _ d | _ t j � | _ d g | _ d S)N�__main__)�_forkserver_address�_forkserver_alive_fd�_inherited_fds� threading�Lock�_lock�_preload_modules)�self� r �//opt/alt/python35/lib64/python3.5/forkserver.py�__init__! s zForkServer.__init__c C s5 t d d � | j D� � s( t d � � | | _ d S)Nc s s! | ] } t | � t k Vq d S)N)�type�str)�.0�modr r r � <genexpr>* s z4ForkServer.set_forkserver_preload.<locals>.<genexpr>z&module_names must be a list of strings)�allr � TypeError)r Z modules_namesr r r r ( s z!ForkServer.set_forkserver_preloadc C s | j S)N)r )r r r r r . s zForkServer.get_inherited_fdsc C s | j � t | � d t k r, t d � � t j t j � �� } | j | j � t j � \ } } t j � \ } } | | | j t j � g } | | 7} zJ y t j | | � | | f SWn% t j | � t j | � � Yn XWd t j | � t j | � XWd QRXd S)N� ztoo many fds)r �len�MAXFDS_TO_SEND� ValueError�socket�AF_UNIX�connectr �os�piper r Zgetfdr �sendfds�close)r �fds�clientZparent_r�child_w�child_rZparent_wZallfdsr r r r 6 s&