4 from Loader
import Loader
5 from Coroutine
import Coroutine
7 #def _excepthandler (exc_class, exc_inst, trace):
9 # # print out stuff ignoring our debug redirect
10 # sys.__excepthook__ (exc_class, exc_inst, trace)
14 def __init__(self
, fn
):
24 filename
= co
.co_filename
26 # strip off the cwd, for if running uninstalled
30 if filename
[:len(cwd
)] == cwd
:
31 filename
= filename
[len(cwd
):]
33 # add the class name to the method, if 'self' exists
34 methodname
= co
.co_name
35 if fr
.f_locals
.has_key('self'):
36 methodname
= '%s.%s' % (fr
.f_locals
['self'].__class
__.__name
__, methodname
)
38 rb
._debug
(methodname
, filename
, co
.co_firstlineno
+ fr
.f_lineno
, True, str)
42 def fileno(self
): return self
.fn
43 def isatty(self
): return 0
44 def read(self
, a
): return ''
45 def readline(self
): return ''
46 def readlines(self
): return []
48 def seek(self
, a
): raise IOError, (29, 'Illegal seek')
49 def tell(self
): raise IOError, (29, 'Illegal seek')
52 sys
.stdout
= _rbdebugfile(sys
.stdout
.fileno())
53 #sys.excepthook = _excepthandler