summaryrefslogtreecommitdiff
path: root/Lib/idlelib/debugger_r.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2021-01-10 01:59:47 -0500
committerGitHub <noreply@github.com>2021-01-10 01:59:47 -0500
commit81f87bbf9f65702062021a78abd9b8f82c98a414 (patch)
tree5f0289ff5b48515f408ea94919ea9b9842acb588 /Lib/idlelib/debugger_r.py
parentd16f6176abdecbb7ab231dc78beccfaa095beff6 (diff)
downloadcpython-git-81f87bbf9f65702062021a78abd9b8f82c98a414.tar.gz
bpo-33065: Fix problem debugging user classes with __repr__ method (GH-24183)
If __repr__ uses instance attributes, as normal, and one steps through the __init__ method, debugger may try to get repr before the instance attributes exist. reprlib.repr handles the error.
Diffstat (limited to 'Lib/idlelib/debugger_r.py')
-rw-r--r--Lib/idlelib/debugger_r.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/idlelib/debugger_r.py b/Lib/idlelib/debugger_r.py
index 9dcfc56414..2620443885 100644
--- a/Lib/idlelib/debugger_r.py
+++ b/Lib/idlelib/debugger_r.py
@@ -19,7 +19,7 @@ arguments and return values that cannot be transported through the RPC
barrier, in particular frame and traceback objects.
"""
-
+import reprlib
import types
from idlelib import debugger
@@ -170,7 +170,7 @@ class IdbAdapter:
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----------
@@ -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)