a
    2bâ  ã                   @   s^   d Z ddlZddlZddlmZmZ ej ej e	¡¡Z
ej e
dd¡Zdd„ Zd
dd	„ZdS )z4A Jupyter-aware wrapper for the yarn package manageré    N)ÚwhichÚ
subprocessZstagingzyarn.jsc                 C   sp   t | ƒ} tjdkr`ddl}ddl}t | g|dd…  ¡}| |j|j¡ | 	¡  | 
|j¡ nt | |¡ dS )a  Execvp, except on Windows where it uses Popen.

    The first argument, by convention, should point to the filename
    associated with the file being executed.

    Python provides execvp on Windows, but its behavior is problematic
    (Python bug#9148).
    Úntr   Né   )r   ÚosÚnameÚsignalÚsysr   ÚPopenÚSIGINTÚSIG_IGNÚwaitÚexitÚ
returncodeÚexecvp)ÚcmdÚargvr   r	   Úp© r   ú1lib/python3.9/site-packages/jupyterlab/jlpmapp.pyr      s    	
r   c                 C   s(   | pt jdd… } tddtg|  ƒ dS )z$Run node and return the result.
    r   NZnode)r	   r   r   Ú	YARN_PATH)r   r   r   r   Úmain&   s    r   )N)Ú__doc__r	   r   Zjupyterlab_server.processr   r   ÚpathÚdirnameÚabspathÚ__file__ZHEREÚjoinr   r   r   r   r   r   r   Ú<module>   s   