summaryrefslogtreecommitdiff
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-07-22 13:35:21 +0000
committerGuido van Rossum <guido@python.org>1998-07-22 13:35:21 +0000
commit811945af808f4aee321516b4a4ffdcf2f93f6d11 (patch)
tree80f8f4c8af080d9195c44cba1e68544c8f2f4305 /Lib/pdb.py
parentd72f0a7a720497408cba90a7f80361c39048238f (diff)
downloadcpython-811945af808f4aee321516b4a4ffdcf2f93f6d11.tar.gz
Feature added by Harri Pasanen (at my suggestion): .py suffix on
filename may be omitted.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 2824f4c22d..f7462a900f 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -421,19 +421,21 @@ class Pdb(bdb.Bdb, cmd.Cmd):
The line number may be prefixed with a filename and a colon,
to specify a breakpoint in another file (probably one that
- hasn't been loaded yet). The file is searched on sys.path."""
+ hasn't been loaded yet). The file is searched on sys.path;
+ the .py suffix may be omitted."""
def help_clear(self):
self.help_cl()
def help_cl(self):
- print """cl(ear) [lineno]
+ print """cl(ear) [file:][lineno]
With a line number argument, clear that break in the current file.
Without argument, clear all breaks (but first ask confirmation).
The line number may be prefixed with a filename and a colon,
to specify a breakpoint in another file (probably one that
- hasn't been loaded yet). The file is searched on sys.path."""
+ hasn't been loaded yet). The file is searched on sys.path;
+ the .py suffix may be omitted."""
def help_step(self):
self.help_s()
@@ -517,6 +519,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
def lookupmodule(self, filename):
if filename == mainmodule:
return mainpyfile
+ root, ext = os.path.splitext(filename)
+ if ext == '':
+ filename = filename + '.py'
+ if os.path.isabs(filename):
+ return filename
for dirname in sys.path:
fullname = os.path.join(dirname, filename)
if os.path.exists(fullname):