MCPcopy Create free account
hub / github.com/pexpect/pexpect / ExceptionPexpect

Class ExceptionPexpect

pexpect/exceptions.py:6–26  ·  view source on GitHub ↗

Base class for all exceptions raised by this module.

Source from the content-addressed store, hash-verified

4import sys
5
6class ExceptionPexpect(Exception):
7 '''Base class for all exceptions raised by this module.
8 '''
9
10 def __init__(self, value):
11 super(ExceptionPexpect, self).__init__(value)
12 self.value = value
13
14 def __str__(self):
15 return str(self.value)
16
17 def get_trace(self):
18 '''This returns an abbreviated stack trace with lines that only concern
19 the caller. In other words, the stack trace inside the Pexpect module
20 is not included. '''
21
22 tblist = traceback.extract_tb(sys.exc_info()[2])
23 tblist = [item for item in tblist if ('pexpect/__init__' not in item[0])
24 and ('pexpect/expect' not in item[0])]
25 tblist = traceback.format_list(tblist)
26 return ''.join(tblist)
27
28
29class EOF(ExceptionPexpect):

Callers 6

test_pickingMethod · 0.90
_wrap_ptyprocess_errFunction · 0.85
_spawnMethod · 0.85
__init__Method · 0.85
terminateMethod · 0.85
my_forkptyFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_pickingMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…