summaryrefslogtreecommitdiffstats
path: root/Lib/bdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-05-05 09:00:19 (GMT)
committerGeorg Brandl <georg@python.org>2009-05-05 09:00:19 (GMT)
commit243ad66ba63f6af19ca941add4b5a29eae109f31 (patch)
tree0b0078f87750df9a8ae60f251976790b4035729e /Lib/bdb.py
parent991f9202bede42b033e499525755daed4a1c07be (diff)
downloadcpython-243ad66ba63f6af19ca941add4b5a29eae109f31.zip
cpython-243ad66ba63f6af19ca941add4b5a29eae109f31.tar.gz
cpython-243ad66ba63f6af19ca941add4b5a29eae109f31.tar.bz2
Merged revisions 72322 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72322 | georg.brandl | 2009-05-05 10:54:11 +0200 (Di, 05 Mai 2009) | 1 line #5142: add module skipping feature to pdb. ........
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r--Lib/bdb.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py
index 6dc54ed..3b4f991 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -1,5 +1,6 @@
"""Debugger basics"""
+import fnmatch
import sys
import os
import types
@@ -19,7 +20,8 @@ class Bdb:
The standard debugger class (pdb.Pdb) is an example.
"""
- def __init__(self):
+ def __init__(self, skip=None):
+ self.skip = set(skip) if skip else None
self.breaks = {}
self.fncache = {}
@@ -94,9 +96,18 @@ class Bdb:
# methods, but they may if they want to redefine the
# definition of stopping and breakpoints.
+ def is_skipped_module(self, module_name):
+ for pattern in self.skip:
+ if fnmatch.fnmatch(module_name, pattern):
+ return True
+ return False
+
def stop_here(self, frame):
# (CT) stopframe may now also be None, see dispatch_call.
# (CT) the former test for None is therefore removed from here.
+ if self.skip and \
+ self.is_skipped_module(frame.f_globals.get('__name__')):
+ return False
if frame is self.stopframe:
return frame.f_lineno >= self.stoplineno
while frame is not None and frame is not self.stopframe: