3
Ävhä ã @ s8 d dl Z d dlZd dlmZ dd„ Zdd„ Zdd„ ZdS ) é N)Úsixc C sV t | tjƒrtjd| ƒS y$| jdƒ} tjd| ƒ} | jdƒ} W n tk
rP Y nX | S )NZNFDzutf-8)Ú
isinstancer Ú text_typeÚunicodedataZ normalizeÚdecodeÚencodeÚUnicodeError)Úpath© r
ú#/usr/lib/python3.6/unicode_utils.pyÚ decompose s
r c C sX t | tjƒr| S tjƒ pd}|df}x.|D ]&}y
| j|ƒS tk
rN w*Y q*X q*W dS )zY
Ensure that the given path is decoded,
NONE when no expected encoding works
zutf-8N)r r r ÚsysÚgetfilesystemencodingr ÚUnicodeDecodeError)r Zfs_encZ
candidatesÚencr
r
r Úfilesys_decode s
r c C s$ y
| j |ƒS tk
r dS X dS )z/turn unicode encoding into a functional routineN)r ÚUnicodeEncodeError)Ústringr r
r
r Ú
try_encode' s
r )r r
Zsetuptools.externr r r r r
r
r
r Ú