3
.]P @ s d dl Z d dlZd dlZd dlZd dlZddlmZmZmZ ddl m
Z
mZmZ ej
d dkZerfeneZG dd deZG dd d eZdS )
N )ExceptionPexpectEOFTIMEOUT)Expectersearcher_stringsearcher_re c @ s, e Zd ZdZedddZed ddZdS )
_NullCoderzPass bytes through unchanged.Fc C s | S )N )bfinalr r /usr/lib/python3.6/spawnbase.pyencode s z_NullCoder.encodec C s | S )Nr )r r
r r r decode s z_NullCoder.decodeN)F)F)__name__
__module____qualname____doc__staticmethodr r r r r r r
s
r
c @ s e Zd ZdZdZdZdZd0ddZd d
Zdd Z d
d Z
d1ddZdd Zdd Z
d4ddZd7ddZd:ddZd=ddZd?ddZdAd d!Zd"d# ZdCd$d%Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ ZdS )D SpawnBasezA base class providing the backwards-compatible spawn API for Pexpect.
This should not be instantiated directly: use :class:`pexpect.spawn` or
:class:`pexpect.fdpexpect.fdspawn`.
NF strictc C s t j| _t j| _t j| _d | _d| _d | _d | _d | _d | _ d| _
d | _d | _d | _
d| _|| _t| _|| _d | _d | _|| _|d krt nt | _|| _d| _d| _d| _d| _d| _dt| d | _ d| _!|| _"|| _#|d krJt$ | _%| _&t| _'d | _(t)r.tt*f| _+t,j-j.d
| _-dd }|| _/nt0f| _+t,j-| _-t jj1| _/n\t2j3||| _%t2j4||| _&t| _'d
| _(tf| _+t)rt,j-| _-nt,j-j5d
| _-t jj1| _/d | _6d S )NFTr g?g?g-C6?<>s
asciic S s8 yt jjj| S tk
r2 t jj| jddS X d S )Nr replace)sysstdoutbufferwriteAttributeErrorr )r r r r write_to_stdout^ s z+SpawnBase.__init__.