Commit d75e7b89 authored by Julien Muchembled's avatar Julien Muchembled

qa: make ClusterPdb compatible with the simple pdb of neo.tests

When 'neo.tests.cluster' is loaded (usually when functional tests are run),
__builtin__.pdb is replaced by an extended pdb, which should behave the same
way if it is used like the former.

winpdb is so slow that a console pdb is often preferred.
parent 71421744
...@@ -104,7 +104,7 @@ class ClusterPdb(object): ...@@ -104,7 +104,7 @@ class ClusterPdb(object):
def broken_peer(self): def broken_peer(self):
return self._getLastPdb(os.getpid()) is None return self._getLastPdb(os.getpid()) is None
def __call__(self, max_count=None, depth=0, text=None): def __call__(self, depth=0, max_count=None, gui=False):
depth += 1 depth += 1
if max_count: if max_count:
frame = sys._getframe(depth) frame = sys._getframe(depth)
...@@ -113,13 +113,8 @@ class ClusterPdb(object): ...@@ -113,13 +113,8 @@ class ClusterPdb(object):
self._count_dict[key] = count = 1 + self._count_dict.get(key, 0) self._count_dict[key] = count = 1 + self._count_dict.get(key, 0)
if max_count < count: if max_count < count:
return return
if not text: if gui:
try:
import rpdb2 import rpdb2
except ImportError:
if text is not None:
raise
else:
if rpdb2.g_debugger is None: if rpdb2.g_debugger is None:
rpdb2_CStateManager = rpdb2.CStateManager rpdb2_CStateManager = rpdb2.CStateManager
def CStateManager(*args, **kw): def CStateManager(*args, **kw):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment