FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.8] bpo-33065: Fix problem debugging user classes with __repr__ method (GH-24183) by miss-islington · Pull Request #24185 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) .txt  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 2 additions & 0 deletions Lib/idlelib/NEWS.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Released on 2020-12-??
======================================


bpo-33065: Fix problem debugging user classes with __repr__ method.

bpo-32631: Finish zzdummy example extension module: make menu entries
work; add docstrings and tests with 100% coverage.

Expand Down
6 changes: 3 additions & 3 deletions Lib/idlelib/debugger_r.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
barrier, in particular frame and traceback objects.

"""

import reprlib
import types
from idlelib import debugger

Expand Down Expand Up @@ -170,7 +170,7 @@ def dict_keys_list(self, did):
def dict_item(self, did, key):
dict = dicttable[did]
value = dict[key]
value = repr(value) ### can't pickle module 'builtins'
value = reprlib.repr(value) ### can't pickle module 'builtins'
return value

#----------end class IdbAdapter----------
Expand Down Expand Up @@ -390,4 +390,4 @@ def restart_subprocess_debugger(rpcclt):

if __name__ == "__main__":
from unittest import main
main('idlelib.idle_test.test_debugger', verbosity=2, exit=False)
main('idlelib.idle_test.test_debugger_r', verbosity=2, exit=False)
14 changes: 14 additions & 0 deletions Lib/idlelib/idle_test/test_debugger_r.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,19 @@ def test_init(self):
# Classes GUIProxy, IdbAdapter, FrameProxy, CodeProxy, DictProxy,
# GUIAdapter, IdbProxy plus 7 module functions.

class IdbAdapterTest(unittest.TestCase):

def test_dict_item_noattr(self): # Issue 33065.

class BinData:
def __repr__(self):
return self.length

debugger_r.dicttable[0] = {'BinData': BinData()}
idb = debugger_r.IdbAdapter(None)
self.assertTrue(idb.dict_item(0, 'BinData'))
debugger_r.dicttable.clear()


if __name__ == '__main__':
unittest.main(verbosity=2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix problem debugging user classes with __repr__ method.

Back | FazBrowse Home | New Git URL