"""Exception classes used by Pexpect""" import traceback import sys class ExceptionPexpect(Exception): '''Base class for all exceptions raised by this module. ''' def __init__(self, value): super(ExceptionPexpect, self).__init__(value) self.value = value def __str__(self): return str(self.value) def get_trace(self): '''This returns an abbreviated stack trace with lines that only concern the caller. In other words, the stack trace inside the Pexpect module is not included. ''' tblist = traceback.extract_tb(sys.exc_info()[2]) tblist = [item for item in tblist if ('pexpect/__init__' not in item[0]) and ('pexpect/expect' not in item[0])] tblist = traceback.format_list(tblist) return ''.join(tblist) class EOF(ExceptionPexpect): '''Raised when EOF is read from a child. This usually means the child has exited.''' class TIMEOUT(ExceptionPexpect): '''Raised when a read time exceeds the timeout. '''
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
ANSI.py | File | 11.89 KB | 0644 |
|
FSM.py | File | 13.1 KB | 0644 |
|
__init__.py | File | 3.81 KB | 0644 |
|
async.py | File | 2.28 KB | 0644 |
|
bashrc.sh | File | 85 B | 0644 |
|
exceptions.py | File | 1.04 KB | 0644 |
|
expect.py | File | 10.45 KB | 0644 |
|
fdpexpect.py | File | 5.49 KB | 0644 |
|
popen_spawn.py | File | 5.42 KB | 0644 |
|
pty_spawn.py | File | 34.04 KB | 0644 |
|
pxssh.py | File | 18.43 KB | 0644 |
|
replwrap.py | File | 5.04 KB | 0644 |
|
run.py | File | 6.48 KB | 0644 |
|
screen.py | File | 13.39 KB | 0644 |
|
spawnbase.py | File | 19.62 KB | 0644 |
|
utils.py | File | 4.73 KB | 0644 |
|