File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 160
160
List source code for the current file.
161
161
Without arguments, list 11 lines around the current line
162
162
or continue the previous listing.
163
+ With . as argument, list 11 lines around the current line.
163
164
With one argument, list 11 lines starting at that line.
164
165
With two arguments, list the given range;
165
166
if the second argument is less than the first, it is a count.
@@ -997,7 +998,7 @@ def do_pp(self, arg):
997
998
def do_list (self , arg ):
998
999
self .lastcmd = 'list'
999
1000
last = None
1000
- if arg :
1001
+ if arg and arg != '.' :
1001
1002
try :
1002
1003
x = eval (arg , {}, {})
1003
1004
if type (x ) == type (()):
@@ -1012,7 +1013,7 @@ def do_list(self, arg):
1012
1013
except :
1013
1014
print ('*** Error in argument:' , repr (arg ), file = self .stdout )
1014
1015
return
1015
- elif self .lineno is None :
1016
+ elif self .lineno is None or arg == '.' :
1016
1017
first = max (1 , self .curframe .f_lineno - 5 )
1017
1018
else :
1018
1019
first = self .lineno + 1
Original file line number Diff line number Diff line change @@ -475,6 +475,9 @@ C-API
475
475
Library
476
476
-------
477
477
478
+ - Issue #4179: In pdb, allow "list ." as a command to return to the
479
+ currently debugged line.
480
+
478
481
- Issue #4108: In urllib.robotparser, if there are multiple 'User-agent: *'
479
482
entries, consider the first one.
480
483
You can’t perform that action at this time.
0 commit comments