Skip to content

Instantly share code, notes, and snippets.

$ pdb hello_pdb.py
*** Info : Psyco module replaced with pdb_psyco_stub
> /home/sevas/code/python/hello_pdb.py(1)()
-> import psyco
(Pdb) c
Traceback (most recent call last):
...snip...
File "hello_pdb.py", line 7, in foo
1/0
ZeroDivisionError: integer division or modulo by zero
@sevas
sevas / dotpdbrc
Created September 11, 2010 13:16
#.pdbrc
import sys
import os
sys.path += [os.getenv("HOME")]
import pdb_psyco_stub
sys.modules['psyco'] = pdb_psyco_stub
print '*** Info : Psyco module replaced with pdb_psyco_stub'
from pprint import pprint
"""
Psyco stub: should implement all the external API from psyco.
Taken from the pydev eclipse extension.
"""
def proxy(func, *args, **kwargs):
return func
def bind(func, *args, **kwargs):
return func
$ pdb hello_pdb.py
> /home/sevas/code/python/hello_pdb.py(1)()
-> import psyco
(Pdb) c
Traceback (most recent call last):
File "/usr/bin/pdb", line 1213, in main
pdb._runscript(mainpyfile)
File "/usr/bin/pdb", line 1138, in _runscript
self.run(statement, globals=globals_, locals=locals_)
File "/usr/lib/python2.5/bdb.py", line 366, in run
import psyco
psyco.full()
def foo(arg):
"""triggers a breakpoint"""
i, j, k = [arg]*3
1/0
return arg*2
if __name__ == '__main__':