# If pdbrc.py is missing, you get an error message (which doesn't hurt).
import os
+import sys
+
x = execfile(os.path.expanduser("~/lib/python/pdbrc.py"))
+
+# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498182
+# replace the Pdb class's complete method with ours
+sys._getframe(1).f_globals['Pdb'].complete = complete
+# set use_rawinput to 1 as tab completion relies on rawinput being used
+sys._getframe(1).f_locals['self'].use_rawinput = 1