@contextmanager
def _wrap_ptyprocess_err():
 try:
  (yield)
 except ptyprocess.PtyProcessError as e:
  raise ExceptionPexpect(*e.args)

@ contextmanager def _wrap_ptyprocess_err ( ) : try : ( yield ) except ptyprocess . PtyProcessError as e : raise ExceptionPexpect ( * e . args )
turn ptyprocess errors into our own exceptionpexpect errors .