diff options
author | Guido van Rossum <guido@python.org> | 1998-07-22 13:35:21 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-07-22 13:35:21 (GMT) |
commit | 1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e (patch) | |
tree | 0523bbb811748c8d86e3e84edaa5decd281969ee /Lib/pdb.py | |
parent | 1ee36ffca092d60d38c9ec463fd6f047d43664e0 (diff) | |
download | cpython-1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e.zip cpython-1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e.tar.gz cpython-1f00eed8b5f88cd4982f4c9dabdc30d31c1e635e.tar.bz2 |
Feature added by Harri Pasanen (at my suggestion): .py suffix on
filename may be omitted.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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): |