관리-도구
편집 파일: xmlrpc.cpython-38.pyc
U ��.e= � @ sP d Z ddlZddlmZ ddlmZ ddlmZ e� e �ZG dd� dej�Z dS )z#xmlrpclib.Transport implementation � N)�requests)� xmlrpc_client)�parsec @ s$ e Zd ZdZddd�Zd dd�ZdS ) �PipXmlrpcTransportzRProvide a `xmlrpclib.Transport` implementation via a `PipSession` object. Fc C s* t j�| |� t�|�}|j| _|| _d S )N)r � Transport�__init__�urllib_parseZurlparseZscheme�_scheme�_session)�selfZ index_urlZsessionZuse_datetimeZindex_parts� r �@/usr/lib/python3.8/site-packages/pip/_internal/network/xmlrpc.pyr s zPipXmlrpcTransport.__init__c C s� | j ||d d d f}t�|�}z8ddi}| jj|||dd�}|�� || _| �|j�W S t j k r� } zt�d| j j|� � W 5 d } ~ X Y nX d S )NzContent-Typeztext/xmlT)�data�headers�streamzHTTP error %s while getting %s)r r Z urlunparser ZpostZraise_for_status�verboseZparse_response�rawr Z HTTPError�loggerZcritical�responseZstatus_code) r ZhostZhandlerZrequest_bodyr �partsZurlr r �excr r r �request s$ � �zPipXmlrpcTransport.requestN)F)F)�__name__� __module__�__qualname__�__doc__r r r r r r r s r )r ZloggingZpip._vendorr Zpip._vendor.six.movesr Zpip._vendor.six.moves.urllibr r Z getLoggerr r r r r r r r �<module> s