Format: application/x-python-code
1 o
2
3 7'hl � @ s� d dl mZ d dlZd dlZd dlZddlmZmZmZm Z m
4 Z
5 mZmZm
6 Z
7 ddlmZmZmZ G dd� de�ZG d d
8 � d
9 e�ZdS )� )�annotationsN� )�ConnectError�ConnectTimeout�ExceptionMapping� ReadError�ReadTimeout�
10 WriteError�WriteTimeout�map_exceptions� )�
11 SOCKET_OPTION�AsyncNetworkBackend�AsyncNetworkStreamc @ s\ e Zd Zd#dd�Zd$d%d
12 d�Zd$d&dd�Zd'dd�Z d(d)dd�Zd*dd�Zd+d!d"�Z dS ),�
13 TrioStream�stream�trio.abc.Stream�return�Nonec C s
14 || _ d S �N)�_stream��selfr � r �MC:\Users\shubh\Videos\agent\nova\Lib\site-packages\httpcore/_backends/trio.py�__init__ s
15 zTrioStream.__init__N� max_bytes�int�timeout�float | None�bytesc � s� �|d u r t d�n|}tjttjttjti}t|��1 t�|�� | j j
16 |d�I d H }|W d � W d � S 1 s>w Y W d � d S 1 sNw Y d S )N�inf)r )�float�trio�TooSlowErrorr �BrokenResourceErrorr �ClosedResourceErrorr �
17 fail_afterr Zreceive_some)r r r �timeout_or_inf�exc_map�datar r r �read s ��
18 ��"�zTrioStream.read�bufferc � s� �|sd S |d u r
19 t d�n|}tjttjttjti}t|��0 t�|�� | j j
20 |d�I d H W d � n1 s9w Y W d � d S W d � d S 1 sQw Y d S )Nr! )r* )r"