diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-08-27 01:17:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 01:17:05 (GMT) |
commit | 641279e6e51b5d2e10d3fbffe6330e47c94c4bb2 (patch) | |
tree | ca3a909e02b7ea85d7c832c1147b6231f74ac8b9 /Lib/pdb.py | |
parent | 7475aa2c590e33a47f5e79e4079bca0645e93f2f (diff) | |
download | cpython-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-x | Lib/pdb.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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: |