U
    ˜ARdÖ  ã                   @   sd   d dl Z d dlZd dlZd dlZe ¡ ZedkZedkZedkpFdekZdd„ Z	dd	„ Z
d
d„ ZdS )é    NÚWindowsÚDarwinÚLinuxZBSDc                   C   s   t  dtjd ¡rdS dS )z¤Return if streamlit running in pex.

    Pex modifies sys.path so the pex file is the first path and that's
    how we determine we're running in the pex file.
    z.*pex$r   TF)ÚreÚmatchÚsysÚpath© r	   r	   ú6/tmp/pip-unpacked-wheel-b9et7o5g/streamlit/env_util.pyÚis_pex   s    r   c                  C   sD   ddl } |  ¡ d }|d }| tj dd¡¡r4dS |dkr@dS d	S )
z*Return True if running in the Python REPL.r   Néÿÿÿÿé   ÚbinZipythonT)z<stdin>z<string>F)ÚinspectÚstackÚendswithÚosr   Újoin)r   Z
root_frameÚfilenamer	   r	   r
   Úis_repl%   s    r   c                 C   s   ddl m} || ƒdk	S )z"Check if executable is in OS path.r   )Úfind_executableN)Údistutils.spawnr   )Únamer   r	   r	   r
   Úis_executable_in_path7   s    r   )r   Úplatformr   r   ÚsystemZ_systemZ
IS_WINDOWSZ	IS_DARWINZIS_LINUX_OR_BSDr   r   r   r	   r	   r	   r
   Ú<module>   s   