Commit 1f00eed8 authored by Guido van Rossum's avatar Guido van Rossum

Feature added by Harri Pasanen (at my suggestion): .py suffix on

filename may be omitted.
parent 1ee36ffc
...@@ -421,19 +421,21 @@ class Pdb(bdb.Bdb, cmd.Cmd): ...@@ -421,19 +421,21 @@ class Pdb(bdb.Bdb, cmd.Cmd):
The line number may be prefixed with a filename and a colon, The line number may be prefixed with a filename and a colon,
to specify a breakpoint in another file (probably one that 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): def help_clear(self):
self.help_cl() self.help_cl()
def help_cl(self): 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. With a line number argument, clear that break in the current file.
Without argument, clear all breaks (but first ask confirmation). Without argument, clear all breaks (but first ask confirmation).
The line number may be prefixed with a filename and a colon, The line number may be prefixed with a filename and a colon,
to specify a breakpoint in another file (probably one that 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): def help_step(self):
self.help_s() self.help_s()
...@@ -517,6 +519,11 @@ class Pdb(bdb.Bdb, cmd.Cmd): ...@@ -517,6 +519,11 @@ class Pdb(bdb.Bdb, cmd.Cmd):
def lookupmodule(self, filename): def lookupmodule(self, filename):
if filename == mainmodule: if filename == mainmodule:
return mainpyfile 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: for dirname in sys.path:
fullname = os.path.join(dirname, filename) fullname = os.path.join(dirname, filename)
if os.path.exists(fullname): if os.path.exists(fullname):
......
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