3
[ð]  ã               @   sV   d dl Z d dlZd dlZddlmZ ejejddƒd   Zdd„ Z	dd„ Z
d	d
„ ZdS )é    Né   )ÚPY2Ú.c              C   sp   dd l } ttdƒsdS tjdƒ}d}xF|d k	rj|jjddƒjdƒrR|j}|d7 }q&|jj	| j
j@ rf|S P q&W dS )Nr   Ú	_getframer   Ú__name__Ú zclick.)Ú
__future__ÚhasattrÚsysr   Ú	f_globalsÚgetÚ
startswithÚf_backÚf_codeÚco_flagsÚunicode_literalsÚcompiler_flag)r   ZfrmÚidx© r   ú2/tmp/pip-build-w1as9q70/click/click/_unicodefun.pyÚ_find_unicode_literals_frame   s    



r   c              C   sJ   dsd S t  stjrd S tƒ } | dkr*d S ddlm} |tdƒ| d� d S )NTr   )Úwarna  Click detected the use of the unicode_literals __future__ import.  This is heavily discouraged because it can introduce subtle bugs in your code.  You should instead use explicit u"" literals for your unicode strings.  For more information see https://click.palletsprojects.com/python3/)Ú
stacklevel)r   ÚclickZ disable_unicode_literals_warningr   Úwarningsr   ÚWarning)Z	bad_framer   r   r   r   Ú_check_for_unicode_literals    s    r   c        	      C   s´  t rdS yddl} tj| jƒ ƒj}W n tk
r<   d}Y nX |dkrJdS d}tjdk�r¤ddl}y$|j	ddg|j
|j
d�jƒ d }W n tk
rž   d	}Y nX tƒ }d
}t|tƒrÀ|jddƒ}x@|jƒ D ]4}|jƒ } | jƒ jdƒrÊ|j| ƒ | jƒ dkrÊd}qÊW |d7 }|�s|d7 }n&|�r*|d7 }n|ddjt|ƒƒ 7 }d}xHtjjdƒtjjdƒfD ],} | �r|| jƒ jdƒ�r|| }| dk	�r^P �q^W |dk	�r¤|d| 7 }td| ƒ‚dS )z=Ensures that the environment is good for unicode on Python 3.Nr   Úasciir   ÚposixÚlocalez-a)ÚstdoutÚstderró    FÚreplaceú.utf-8ú.utf8úc.utf8úc.utf-8Tz

zšAdditional information: on this system no suitable UTF-8
locales were discovered.  This most likely requires resolving
by reconfiguring the locale system.zÊThis system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8z‚This system lists a couple of UTF-8 supporting locales that
you can pick from.  The following suitable locales were
discovered: %sz, ÚLC_ALLÚLANGz³

Click discovered that you exported a UTF-8 locale
but the locale system could not pick up from it because
it does not exist.  The exported locale is "%s" but it
is not supportedzÀClick will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/en/7.x/python3/ for mitigation steps.)r$   r%   )r&   r'   )r$   r%   )r   r   ÚcodecsÚlookupÚgetpreferredencodingÚnameÚ	ExceptionÚosÚ
subprocessÚPopenÚPIPEÚcommunicateÚOSErrorÚsetÚ
isinstanceÚbytesÚdecodeÚ
splitlinesÚstripÚlowerÚendswithÚaddÚjoinÚsortedÚenvironr   ÚRuntimeError)	r   Zfs_encÚextrar0   ÚrvZgood_localesZ
has_c_utf8ÚlineZ
bad_localer   r   r   Ú_verify_python3_env2   sd    





rE   )r/   r
   r*   Ú_compatr   Úmodulesr   Úrsplitr   r   r   rE   r   r   r   r   Ú<module>   s   