XylotrechusZ
U
��.e� � @ sh d dl Z d dlZd dlmZ d dlmZ d dlmZ erLd dl m
Z
mZmZ dd� Z
dd � Zd
d� ZdS )� N)�parse)�request)�MYPY_CHECK_RUNNING)�Optional�Text�Unionc C s d| krd S | � dd�d �� S )N�:� r )�split�lower)�url� r
�</usr/lib/python3.8/site-packages/pip/_internal/utils/urls.py�get_url_scheme
s r c C s* t j�t j�| ��} t�dt�| ��}|S )zh
Convert a path to a file: URL. The path will be made absolute and have
quoted path parts.
�file:)�os�path�normpath�abspath�urllib_parseZurljoin�urllib_requestZpathname2url)r r r
r
r �path_to_url s r c C sn | � d�std| ��t�| �\}}}}}|r6|dkr<d}n tjdkrPd| }ntd| ��t�|| �}|S )z(
Convert a file: URL to a path.
r z4You can only turn file: urls into filenames (not %r)Z localhost� Zwin32z\\z:non-local file URIs are not supported on this platform: %r) �
startswith�AssertionErrorr Zurlsplit�sys�platform�
ValueErrorr Zurl2pathname)r �_Znetlocr r
r
r �url_to_path s �
��r )r r Zpip._vendor.six.moves.urllibr r r r Zpip._internal.utils.typingr �typingr r r r r r r
r
r
r �<module> s