관리-도구
편집 파일: pep514.cpython-37.pyc
B ���aK � @ s� d Z ddlmZmZmZ ddlZddlZddlmZm Z ddl Z e jrPddlZnddl Ze e�Zdd� Zdd� Zd d � Zdd� Zd d� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zedkr�e� dS ) z[Implement https://www.python.org/dev/peps/pep-0514/ to discover interpreters - Windows only� )�absolute_import�print_function�unicode_literalsN)�basicConfig� getLoggerc c s@ d}x6yt �| |�V W n tk r. P Y nX |d7 }qW d S )Nr � )�winreg�EnumKey�OSError)�keyZat� r �T/opt/alt/python37/lib/python3.7/site-packages/virtualenv/discovery/windows/pep514.py� enum_keys s r c C s* yt �| |�d S tk r$ d S X d S )Nr )r �QueryValueExr )r Z value_namer r r � get_value s r c c sj xdt jddddft jddt jdft jddt jdfgD ].\} }}}}xt| ||||�D ] }|V qTW q4W d S )N�HKEY_CURRENT_USERzSoftware\Pythonr �@ �HKEY_LOCAL_MACHINE� )r r r ZKEY_WOW64_64KEY�KEY_WOW64_32KEY�process_set)�hive� hive_namer �flags�default_arch�specr r r �discover_pythons$ s "r c c sz y`t �| |dt j|B ��@}x8t|�D ],}|dkr2q$xt||||�D ] }|V qBW q$W W d Q R X W n tk rt Y nX d S )Nr Z PyLauncher)r � OpenKeyEx�KEY_READr �process_companyr )r r r r r �root_key�companyr r r r r . s r c c sL t �||��6}x.t|�D ]"}t| ||||�}|d k r|V qW W d Q R X d S )N)r r r �process_tag)r r! r r �company_key�tagr r r r r : s r c C s� t �||��l}t| |||�}|d k rt|\}}} t| ||||�} | d k rtt| |||�}|d k rt|\}} |||| || fS W d Q R X d S )N)r r �load_version_data�load_arch_data�load_exe)r r! r# r$ r �tag_key�version�major�minor�_�archZexe_data�exe�argsr r r r"