|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /usr/local/lib/python3.6/site-packages/requests/__pycache__/ |
Upload File : |
3
F�Kd�t � @ s� d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZmZm
Z
mZmZ ddlmZmZmZmZ dd lmZmZmZ dd
lmZmZ ddlmZ ddlmZm Z m!Z! dd
l"m#Z#m$Z$m%Z%m&Z& ddl'm(Z( ddl)m*Z* ddlm+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1 ddl2m3Z3 ddlm4Z4 ej5dk�rZy
ej6Z7W n e8k
�rV ej9Z7Y nX nejZ7efdd�Z:efdd�Z;G dd� de<�Z=G dd� de=�Z>dd� Z?dS )z�
requests.sessions
~~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
� N)� timedelta)�OrderedDict� )�_basic_auth_str)� cookielib�is_py3�urljoin�urlparse�Mapping)�cookiejar_from_dict�extract_cookies_to_jar�RequestsCookieJar�
merge_cookies)�Request�PreparedRequest�DEFAULT_REDIRECT_LIMIT)�
default_hooks�
dispatch_hook)�to_native_string)�to_key_val_list�default_headers�
DEFAULT_PORTS)�TooManyRedirects�
InvalidSchema�ChunkedEncodingError�ContentDecodingError)�CaseInsensitiveDict)�HTTPAdapter)�requote_uri�get_environ_proxies�get_netrc_auth�should_bypass_proxies�get_auth_from_url�rewind_body�resolve_proxies)�codes)�REDIRECT_STATI�win32c C st |dkr| S | dkr|S t |t�o*t | t�s0| S |t|��}|jt| �� dd� |j� D �}x|D ]
}||= qbW |S )z�Determines appropriate setting for a given request, taking into account
the explicit setting on that request, and the setting in the session. If a
setting is a dictionary, they will be merged together using `dict_class`
Nc S s g | ]\}}|d kr|�qS )N� )�.0�k�vr( r( �5/tmp/pip-build-8nxjc3nm/requests/requests/sessions.py�
<listcomp>J s z!merge_setting.<locals>.<listcomp>)�
isinstancer
r �update�items)�request_setting�session_setting�
dict_class�merged_setting� none_keys�keyr( r( r, �
merge_setting2 s
r7 c C s@ |dks|j d�g kr| S | dks0| j d�g kr4|S t| ||�S )z�Properly merges both requests and session hooks.
This is necessary because when request_hooks == {'response': []}, the
merge breaks Session hooks entirely.
N�response)�getr7 )�
request_hooks�
session_hooksr3 r( r( r, �merge_hooksQ s
r<