Your IP : 3.147.49.19


Current Path : /opt/alt/python34/lib64/python3.4/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/distutils/__pycache__/spawn.cpython-34.pyc

�
i fZ�@s�dZddlZddlZddlmZmZddlmZddlm	Z	ddddd�Z
d	d
�Zddddd�Zej
d
kr�ddlmZdadanddddd�Zddd�ZdS)z�distutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
�N)�DistutilsPlatformError�DistutilsExecError)�DEBUG)�log�cCsmt|�}tjdkr1t||d|�n8tjdkrVt||d|�ntdtj��dS)a�Run another program, specified as a command list 'cmd', in a new process.

    'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    �posix�dry_run�ntz1don't know how to spawn programs on platform '%s'N)�list�os�name�_spawn_posix�	_spawn_ntr)�cmd�search_path�verboser�r�4/opt/alt/python34/lib64/python3.4/distutils/spawn.py�spawnsrcCs>x7t|�D])\}}d|kr
d|||<q
q
W|S)z�Quote command-line arguments for DOS/Windows conventions.

    Just wraps every argument which contains blanks in double quotes, and
    returns a new argument list.
    � z"%s")�	enumerate)�args�i�argrrr�_nt_quote_args+srcCs	|d}t|�}|r1t|�p+|}ntjdj|g|dd���|sytjtj||�}WnQtk
r�}z1t	s�|}nt
d||jdf��WYdd}~XnX|dkrt	s�|}nt
d||f��qndS)Nrrrzcommand %r failed: %sz%command %r failed with exit status %d���)r�find_executabler�info�joinr�spawnv�P_WAIT�OSErrorrrr)rrrr�
executable�rc�excrrrr;s$
'	-	r�darwin)�	sysconfigcCsztjdj|��|r dS|d}|r9tjp?tj}d}tjdkr/tdkr�t	j
d�pudatr�dd�tjd�D�aq�ntr/tj
jdt�}td	d�|jd�D�kr�d
|tf}t|��nttj
d|�}|r tjp&tj}q/ntj�}	|	dkry0|dkrf|||�n||||�Wn^tk
r�}
z>ts�|}ntjjd||
jf�tjd�WYdd}
~
XnXts�|}ntjjd
|�tjd�nkxhytj|	d�\}	}Wnutk
r�}zUddl}
|j|
jkrcwntsr|}ntd||jdf��WYdd}~XnXtj|�r�ts�|}ntd|tj |�f��qtj!|�r8tj"|�}|dkrdSts|}ntd||f��qtj#|�rMqqts\|}ntd||f��qWdS)Nrrr%�MACOSX_DEPLOYMENT_TARGET�cSsg|]}t|��qSr)�int)�.0�xrrr�
<listcomp>es	z _spawn_posix.<locals>.<listcomp>�.cSsg|]}t|��qSr)r))r*r+rrrr,ks	zF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configurezunable to execute %r: %s
rz(unable to execute %r for unknown reasonszcommand %r failed: %sz"command %r terminated by signal %dz%command %r failed with exit status %dz1unknown error executing %r: termination status %dr)$rrrr�execvp�execv�sys�platform�_cfg_targetr&�get_config_var�split�_cfg_target_split�environ�getr�dict�execvpe�execve�forkr!r�stderr�write�strerror�_exit�waitpid�errnoZEINTRrr�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED)rrrrr"Zexec_fn�envZ
cur_targetZmy_msg�pid�eZstatusr$rAZexit_statusrrrr
Xs�
""
		 		-			r
cCs�|dkrtjd}n|jtj�}tjj|�\}}tjdkrn|dkrn|d}ntjj|�s�x9|D]1}tjj	||�}tjj|�r�|Sq�WdS|SdS)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    N�PATH�win32z.exe)
rr6r4�pathsep�path�splitextr0r1�isfiler)r"rM�paths�baseZext�p�frrrr�s

r)�__doc__r0rZdistutils.errorsrrZdistutils.debugrZ	distutilsrrrrr1r&r2r5r
rrrrr�<module>s	T

?>