summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-08-27 01:17:05 (GMT)
committerGitHub <noreply@github.com>2020-08-27 01:17:05 (GMT)
commit641279e6e51b5d2e10d3fbffe6330e47c94c4bb2 (patch)
treeca3a909e02b7ea85d7c832c1147b6231f74ac8b9 /Lib/pdb.py
parent7475aa2c590e33a47f5e79e4079bca0645e93f2f (diff)
downloadcpython-641279e6e51b5d2e10d3fbffe6330e47c94c4bb2.zip
cpython-641279e6e51b5d2e10d3fbffe6330e47c94c4bb2.tar.gz
cpython-641279e6e51b5d2e10d3fbffe6330e47c94c4bb2.tar.bz2
bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) (#21976)
(cherry picked from commit 022bc7572f061e1d1132a4db9d085b29707701e7) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 0810235..d7d95715 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1312,21 +1312,21 @@ class Pdb(bdb.Bdb, cmd.Cmd):
# _getval() already printed the error
return
code = None
- # Is it a function?
+ # Is it an instance method?
try:
- code = value.__code__
+ code = value.__func__.__code__
except Exception:
pass
if code:
- self.message('Function %s' % code.co_name)
+ self.message('Method %s' % code.co_name)
return
- # Is it an instance method?
+ # Is it a function?
try:
- code = value.__func__.__code__
+ code = value.__code__
except Exception:
pass
if code:
- self.message('Method %s' % code.co_name)
+ self.message('Function %s' % code.co_name)
return
# Is it a class?
if value.__class__ is type: